diff --git a/swaggerci/storage.DefaultTag/.gitattributes b/swaggerci/storage.DefaultTag/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/.gitignore b/swaggerci/storage.DefaultTag/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/Az.Storage.csproj b/swaggerci/storage.DefaultTag/Az.Storage.csproj new file mode 100644 index 000000000000..8a2a0ba5cbba --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/Az.Storage.format.ps1xml b/swaggerci/storage.DefaultTag/Az.Storage.format.ps1xml new file mode 100644 index 000000000000..9d332f889599 --- /dev/null +++ b/swaggerci/storage.DefaultTag/Az.Storage.format.ps1xml @@ -0,0 +1,6883 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + 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 + + + MigrationName + + + NetworkSecurityPerimeterConfigurationName + + + ObjectReplicationPolicyId + + + PrivateEndpointConnectionName + + + QueueName + + + QueueServiceName + + + ResourceGroupName + + + ShareName + + + StorageTaskAssignmentName + + + SubscriptionId + + + TableName + + + TableServiceName + + + Username + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsCreateAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsCreateAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsDeleteAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsDeleteAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsUpdateAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageTaskAssignmentsUpdateAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfo + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfo + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetail + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetail + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ProxyResourceAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ProxyResourceAutoGenerated + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccessPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccessPolicy + + + + + + + + + + + + + + + + + + ExpiryTime + + + Permission + + + StartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyProperties + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + ImmutabilityPeriodSinceCreationInDay + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountSasParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountSasParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IPAddressOrRange + + + KeyToSign + + + Permission + + + Protocol + + + ResourceType + + + Service + + + SharedAccessExpiryTime + + + SharedAccessStartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountType + + + AzureStorageSid + + + DomainGuid + + + DomainName + + + DomainSid + + + ForestName + + + NetBiosDomainName + + + SamAccountName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication + + + + + + + + + + + + + + + DefaultSharePermission + + + DirectoryServiceOption + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobContainer + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobContainer + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTime + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTime + + + + + + + + + + + + LastNDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyDefinition + + + + + + + + + + + + + + + + + + + + + Format + + + ObjectType + + + Schedule + + + SchemaField + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + BlobType + + + ExcludePrefix + + + IncludeBlobVersion + + + IncludeDeleted + + + IncludeSnapshot + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyProperties + + + + + + + + + + + + LastModifiedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyRule + + + + + + + + + + + + + + + + + + Destination + + + Enabled + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchema + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchema + + + + + + + + + + + + + + + + + + Destination + + + Enabled + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParameters + + + + + + + + + + + + TimeToRestore + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRange + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRange + + + + + + + + + + + + + + + EndRange + + + StartRange + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatus + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatus + + + + + + + + + + + + + + + + + + FailureReason + + + RestoreId + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServicePropertiesAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServicePropertiesAutoGenerated + + + + + + + + + + + + + + + + + + AutomaticSnapshotPolicyEnabled + + + DefaultServiceVersion + + + IsVersioningEnabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeed + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeed + + + + + + + + + + + + + + + Enabled + + + RetentionInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CheckNameAvailabilityResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CheckNameAvailabilityResult + + + + + + + + + + + + + + + + + + Message + + + NameAvailable + + + Reason + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CloudErrorBody + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CloudErrorBody + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DefaultEncryptionScope + + + Deleted + + + DeletedTime + + + DenyEncryptionScopeOverride + + + EnableNfsV3AllSquash + + + EnableNfsV3RootSquash + + + HasImmutabilityPolicy + + + HasLegalHold + + + LastModifiedTime + + + LeaseDuration + + + LeaseState + + + LeaseStatus + + + PublicAccess + + + RemainingRetentionDay + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRule + + + + + + + + + + + + + + + + + + + + + + + + AllowedHeader + + + AllowedMethod + + + AllowedOrigin + + + ExposedHeader + + + MaxAgeInSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain + + + + + + + + + + + + + + + Name + + + UseSubDomainName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation + + + + + + + + + + + + + + + DaysAfterCreationGreaterThan + + + DaysAfterLastTierChangeGreaterThan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification + + + + + + + + + + + + + + + + + + + + + DaysAfterCreationGreaterThan + + + DaysAfterLastAccessTimeGreaterThan + + + DaysAfterLastTierChangeGreaterThan + + + DaysAfterModificationGreaterThan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccount + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountProperties + + + + + + + + + + + + + + + + + + + + + + + + CreationTime + + + DeletionTime + + + Location + + + RestoreReference + + + StorageAccountResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedShare + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedShare + + + + + + + + + + + + + + + Name + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy + + + + + + + + + + + + + + + + + + AllowPermanentDelete + + + Day + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Dimension + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Dimension + + + + + + + + + + + + + + + DisplayName + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Encryption + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Encryption + + + + + + + + + + + + + + + KeySource + + + RequireInfrastructureEncryption + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionIdentity + + + + + + + + + + + + + + + EncryptionFederatedIdentityClientId + + + EncryptionUserAssignedIdentity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScope + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScope + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultProperties + + + + + + + + + + + + + + + + + + CurrentVersionedKeyIdentifier + + + KeyUri + + + LastKeyRotationTimestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeProperties + + + + + + + + + + + + + + + + + + + + + + + + CreationTime + + + LastModifiedTime + + + RequireInfrastructureEncryption + + + Source + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService + + + + + + + + + + + + + + + + + + Enabled + + + KeyType + + + LastEnabledTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Endpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Endpoints + + + + + + + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Queue + + + Table + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ErrorResponseBody + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ErrorResponseBody + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget + + + + + + + + + + + + + + + ExcludePrefix + + + Prefix + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTrigger + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTrigger + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdate + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdate + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShare + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShare + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItem + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItem + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItems + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItems + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AccessTierChangeTime + + + AccessTierStatus + + + Deleted + + + DeletedTime + + + EnabledProtocol + + + LastModifiedTime + + + LeaseDuration + + + LeaseState + + + LeaseStatus + + + RemainingRetentionDay + + + RootSquash + + + ShareQuota + + + ShareUsageByte + + + SnapshotTime + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStats + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStats + + + + + + + + + + + + + + + + + + + + + + + + + + + CanFailover + + + CanPlannedFailover + + + LastSyncTime + + + PostFailoverRedundancy + + + PostPlannedFailoverRedundancy + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity + + + + + + + + + + + + + + + + + + PrincipalId + + + TenantId + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicy + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + ETag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperties + + + + + + + + + + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperty + + + + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + AllowProtectedAppendWritesAll + + + ImmutabilityPeriodSinceCreationInDay + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioning + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioning + + + + + + + + + + + + + + + + + + Enabled + + + MigrationState + + + TimeStamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRule + + + + + + + + + + + + + + + Action + + + IPAddressOrRange + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTime + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTime + + + + + + + + + + + + + + + Key1 + + + Key2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy + + + + + + + + + + + + KeyExpirationPeriodInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + CurrentVersionedKeyExpirationTimestamp + + + CurrentVersionedKeyIdentifier + + + KeyName + + + KeyVaultUri + + + KeyVersion + + + LastKeyRotationTimestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LastAccessTimeTrackingPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LastAccessTimeTrackingPolicy + + + + + + + + + + + + + + + + + + + + + BlobType + + + Enable + + + Name + + + TrackingGranularityInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerRequest + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerRequest + + + + + + + + + + + + + + + + + + + + + + + + Action + + + BreakPeriod + + + LeaseDuration + + + LeaseId + + + ProposedLeaseId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerResponse + + + + + + + + + + + + + + + LeaseId + + + LeaseTimeSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseShareRequest + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseShareRequest + + + + + + + + + + + + + + + + + + + + + + + + Action + + + BreakPeriod + + + LeaseDuration + + + LeaseId + + + ProposedLeaseId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseShareResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseShareResponse + + + + + + + + + + + + + + + + + + ETag + + + LeaseId + + + LeaseTimeSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHold + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHold + + + + + + + + + + + + + + + + + + AllowProtectedAppendWritesAll + + + HasLegalHold + + + Tag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldProperties + + + + + + + + + + + + HasLegalHold + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListAccountSasResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListAccountSasResponse + + + + + + + + + + + + AccountSasToken + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItem + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItem + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItems + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItems + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueue + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueue + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueuePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueuePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueueResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueueResource + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListServiceSasResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListServiceSasResponse + + + + + + + + + + + + ServiceSasToken + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListTableResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListTableResource + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUser + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUser + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserKeys + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserKeys + + + + + + + + + + + + SharedKey + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AllowAclAuthorization + + + ExtendedGroup + + + GroupId + + + HasSharedKey + + + HasSshKey + + + HasSshPassword + + + HomeDirectory + + + IsNfSv3Enabled + + + Sid + + + UserId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserRegeneratePasswordResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserRegeneratePasswordResult + + + + + + + + + + + + SshPassword + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUsers + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUsers + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlob + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlob + + + + + + + + + + + + EnableAutoTierToHotFromCool + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilter + + + + + + + + + + + + + + + BlobType + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyProperties + + + + + + + + + + + + LastModifiedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyRule + + + + + + + + + + + + + + + + + + Enabled + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MetricSpecification + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MetricSpecification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AggregationType + + + Category + + + DisplayDescription + + + DisplayName + + + FillGapWithZero + + + Name + + + ResourceIdDimensionNameOverride + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Multichannel + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Multichannel + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet + + + + + + + + + + + + + + + Bypass + + + DefaultAction + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter + + + + + + + + + + + + + + + + + + Id + + + Location + + + PerimeterGuid + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfiguration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationList + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfile + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfile + + + + + + + + + + + + + + + + + + + + + AccessRulesVersion + + + DiagnosticSettingsVersion + + + EnabledLogCategory + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + + + + + + + + + + + + + + + AccessMode + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRule + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleProperties + + + + + + + + + + + + + + + + + + AddressPrefix + + + Direction + + + FullyQualifiedDomainName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItem + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItem + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyFilter + + + + + + + + + + + + + + + MinCreationTime + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyProperties + + + + + + + + + + + + + + + + + + + + + DestinationAccount + + + EnabledTime + + + PolicyId + + + SourceAccount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyRule + + + + + + + + + + + + + + + + + + DestinationContainer + + + RuleId + + + SourceContainer + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Operation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Operation + + + + + + + + + + + + + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScope + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScope + + + + + + + + + + + + + + + + + + Permission + + + ResourceName + + + Service + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpoint + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpoint + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnection + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnection + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkResourceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkResourceProperties + + + + + + + + + + + + + + + + + + GroupId + + + RequiredMember + + + RequiredZoneName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionState + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionState + + + + + + + + + + + + + + + + + + ActionRequired + + + Description + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistory + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistory + + + + + + + + + + + + + + + AllowProtectedAppendWritesAll + + + Timestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssue + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssue + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueProperties + + + + + + + + + + + + + + + + + + Description + + + IssueType + + + Severity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueProperties + + + + + + + + + + + + ApproximateMessageCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRule + + + + + + + + + + + + + + + ResourceId + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyProperties + + + + + + + + + + + + + + + + + + + + + Day + + + Enabled + + + LastEnabledTime + + + MinRestoreTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Restriction + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Restriction + + + + + + + + + + + + + + + + + + ReasonCode + + + Type + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference + + + + + + + + + + + + + + + + + + PublishInternetEndpoint + + + PublishMicrosoftEndpoint + + + RoutingChoice + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy + + + + + + + + + + + + + + + ExpirationAction + + + SasExpirationPeriod + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSasParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.SignedIdentifier + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifier + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku + + + + + + + + + + + + + + + Name + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuCapability + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuCapability + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuInformation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuInformation + + + + + + + + + + + + + + + + + + + + + + + + Kind + + + Location + + + Name + + + ResourceType + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSetting + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSetting + + + + + + + + + + + + + + + + + + + + + AuthenticationMethod + + + ChannelEncryption + + + KerberosTicketEncryption + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKey + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKey + + + + + + + + + + + + + + + Description + + + Key + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccount + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCheckNameAvailabilityParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCheckNameAvailabilityParameters + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParameters + + + + + + + + + + + + + + + Kind + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpoints + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountKey + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountKey + + + + + + + + + + + + + + + + + + + + + CreationTime + + + KeyName + + + Permission + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpoints + + + + + + + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Queue + + + Table + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigration + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigration + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationProperties + + + + + + + + + + + + + + + + + + + + + MigrationFailedDetailedReason + + + MigrationFailedReason + + + MigrationStatus + + + TargetSkuName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AccountMigrationInProgress + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + CreationTime + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableExtendedGroup + + + EnableHttpsTrafficOnly + + + EnableNfsV3 + + + FailoverInProgress + + + IsHnsEnabled + + + IsLocalUserEnabled + + + IsSftpEnabled + + + IsSkuConversionBlocked + + + LargeFileSharesState + + + LastGeoFailoverTime + + + MinimumTlsVersion + + + PrimaryLocation + + + ProvisioningState + + + PublicNetworkAccess + + + SecondaryLocation + + + StatusOfPrimary + + + StatusOfSecondary + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableExtendedGroup + + + EnableHttpsTrafficOnly + + + EnableNfsV3 + + + IsHnsEnabled + + + IsLocalUserEnabled + + + IsSftpEnabled + + + LargeFileSharesState + + + MinimumTlsVersion + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableExtendedGroup + + + EnableHttpsTrafficOnly + + + IsLocalUserEnabled + + + IsSftpEnabled + + + LargeFileSharesState + + + MinimumTlsVersion + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountRegenerateKeyParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountRegenerateKeyParameters + + + + + + + + + + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatus + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatus + + + + + + + + + + + + + + + + + + + + + EndTime + + + SkuConversionStatus + + + StartTime + + + TargetSkuName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParameters + + + + + + + + + + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageQueue + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageQueue + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignment + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignment + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentProperties + + + + + + + + + + + + + + + + + + + + + Description + + + Enabled + + + ProvisioningState + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReport + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReport + + + + + + + + + + + + Prefix + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentsList + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentsList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateProperties + + + + + + + + + + + + + + + + + + + + + Description + + + Enabled + + + ProvisioningState + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReport + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReport + + + + + + + + + + + + Prefix + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportInstance + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportInstance + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FinishTime + + + ObjectFailedCount + + + ObjectsOperatedOnCount + + + ObjectsSucceededCount + + + ObjectsTargetedCount + + + RunResult + + + RunStatusEnum + + + RunStatusError + + + StartTime + + + StorageAccountId + + + SummaryReportPath + + + TaskAssignmentId + + + TaskId + + + TaskVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportSummary + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportSummary + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Table + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Table + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableAccessPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableAccessPolicy + + + + + + + + + + + + + + + + + + ExpiryTime + + + Permission + + + StartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableProperties + + + + + + + + + + + + TableName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableSignedIdentifier + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableSignedIdentifier + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagFilter + + + + + + + + + + + + + + + + + + Name + + + Op + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagProperty + + + + + + + + + + + + + + + + + + + + + + + + ObjectIdentifier + + + Tag + + + TenantId + + + Timestamp + + + Upn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParameters + + + + + + + + + + + + + + + + + + + + + + + + EndBy + + + Interval + + + IntervalUnit + + + StartFrom + + + StartOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdate + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdate + + + + + + + + + + + + + + + + + + + + + + + + EndBy + + + Interval + + + IntervalUnit + + + StartFrom + + + StartOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryProperty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + AllowProtectedAppendWritesAll + + + ImmutabilityPeriodSinceCreationInDay + + + ObjectIdentifier + + + TenantId + + + Timestamp + + + Update + + + Upn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Usage + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Usage + + + + + + + + + + + + + + + + + + CurrentValue + + + Limit + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UsageName + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UsageName + + + + + + + + + + + + + + + LocalizedValue + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UserAssignedIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UserAssignedIdentity + + + + + + + + + + + + + + + ClientId + + + PrincipalId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/Az.Storage.nuspec b/swaggerci/storage.DefaultTag/Az.Storage.nuspec new file mode 100644 index 000000000000..f7e8b99e1f56 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/Az.Storage.psd1 b/swaggerci/storage.DefaultTag/Az.Storage.psd1 new file mode 100644 index 000000000000..d73ac471cb46 --- /dev/null +++ b/swaggerci/storage.DefaultTag/Az.Storage.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '6007de23-90f8-4c12-a8a6-73ded86d331f' + 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-AzStorageAccountCustomerInitiatedMigration', '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-AzStorageNetworkSecurityPerimeterConfiguration', 'Get-AzStorageObjectReplicationPolicy', 'Get-AzStoragePrivateEndpointConnection', 'Get-AzStoragePrivateLinkResource', 'Get-AzStorageQueue', 'Get-AzStorageQueueService', 'Get-AzStorageQueueServiceProperty', 'Get-AzStorageSku', 'Get-AzStorageTable', 'Get-AzStorageTableService', 'Get-AzStorageTableServiceProperty', 'Get-AzStorageTaskAssignment', 'Get-AzStorageTaskAssignmentInstancesReport', 'Get-AzStorageTaskAssignmentsInstancesReport', 'Get-AzStorageUsage', 'Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration', 'Invoke-AzStorageCustomerStorageAccountInitiatedMigration', 'Invoke-AzStorageExtendBlobContainerImmutabilityPolicy', 'Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration', 'Invoke-AzStorageLeaseBlobContainer', 'Invoke-AzStorageLeaseFileShare', 'Invoke-AzStorageObjectBlobContainerLevelWorm', 'Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration', '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', 'New-AzStorageTaskAssignment', 'Remove-AzStorageAccount', 'Remove-AzStorageBlobContainer', 'Remove-AzStorageBlobContainerImmutabilityPolicy', 'Remove-AzStorageBlobInventoryPolicy', 'Remove-AzStorageFileShare', 'Remove-AzStorageLocalUser', 'Remove-AzStorageManagementPolicy', 'Remove-AzStorageObjectReplicationPolicy', 'Remove-AzStoragePrivateEndpointConnection', 'Remove-AzStorageQueue', 'Remove-AzStorageTable', 'Remove-AzStorageTaskAssignment', 'Restore-AzStorageAccountBlobRange', 'Restore-AzStorageFileShare', 'Revoke-AzStorageAccountUserDelegationKey', 'Test-AzStorageAccountNameAvailability', 'Update-AzStorageAccount', 'Update-AzStorageBlobContainer', 'Update-AzStorageEncryptionScope', 'Update-AzStorageFileShare', 'Update-AzStorageQueue', 'Update-AzStorageTable', 'Update-AzStorageTaskAssignment', '*' + 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.DefaultTag/Az.Storage.psm1 b/swaggerci/storage.DefaultTag/Az.Storage.psm1 new file mode 100644 index 000000000000..6ec2b8c5cd8c --- /dev/null +++ b/swaggerci/storage.DefaultTag/Az.Storage.psm1 @@ -0,0 +1,111 @@ +# 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://learn.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 + + # Delegate to sanitize the output object + $instance.SanitizeOutput = $VTable.SanitizerHandler + + # Delegate to get the telemetry info + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo + + # 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.DefaultTag/MSSharedLibKey.snk b/swaggerci/storage.DefaultTag/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/storage.DefaultTag/MSSharedLibKey.snk differ diff --git a/swaggerci/storage.DefaultTag/README.md b/swaggerci/storage.DefaultTag/README.md new file mode 100644 index 000000000000..135741cb1d10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/README.md @@ -0,0 +1,24 @@ + +# Az.Storage +This directory contains the PowerShell module for the Storage service. + +--- +## 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.DefaultTag/build-module.ps1 b/swaggerci/storage.DefaultTag/build-module.ps1 new file mode 100644 index 000000000000..87143fc38143 --- /dev/null +++ b/swaggerci/storage.DefaultTag/build-module.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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks) +$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 = @() +$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets' +if (Test-Path $modelCmdletFolder) { + $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder +} +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 + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo +} + +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 + +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + +if (-not $DisableAfterBuildTasks){ + $afterBuildTasksPath = Join-Path $PSScriptRoot '' + $afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable + if(Test-Path -Path $afterBuildTasksPath -PathType leaf){ + Write-Host -ForegroundColor Green 'Running after build tasks...' + . $afterBuildTasksPath @afterBuildTasksArgs + } +} + + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/storage.DefaultTag/check-dependencies.ps1 b/swaggerci/storage.DefaultTag/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/create-model-cmdlets.ps1 b/swaggerci/storage.DefaultTag/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..5a820a47d310 --- /dev/null +++ b/swaggerci/storage.DefaultTag/create-model-cmdlets.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + if (''.length -gt 0) { + $ModuleName = '' + } else { + $ModuleName = 'Az.Storage' + } + + $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('Storage')) { + $ModulePrefix = '' + } else { + $ModulePrefix = 'Storage' + } + $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://learn.microsoft.com/powershell/module/${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.DefaultTag/custom/Az.Storage.custom.psm1 b/swaggerci/storage.DefaultTag/custom/Az.Storage.custom.psm1 new file mode 100644 index 000000000000..95c295865eb6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/custom/README.md b/swaggerci/storage.DefaultTag/custom/README.md new file mode 100644 index 000000000000..38ed8ed6f722 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.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.DefaultTag/docs/Az.Storage.md b/swaggerci/storage.DefaultTag/docs/Az.Storage.md new file mode 100644 index 000000000000..f58cd1601701 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Az.Storage.md @@ -0,0 +1,292 @@ +--- +Module Name: Az.Storage +Module Guid: 6007de23-90f8-4c12-a8a6-73ded86d331f +Download Help Link: https://learn.microsoft.com/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-AzStorageAccountCustomerInitiatedMigration](Get-AzStorageAccountCustomerInitiatedMigration.md) +Gets the status of the ongoing migration for the specified storage account. + +### [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-AzStorageNetworkSecurityPerimeterConfiguration](Get-AzStorageNetworkSecurityPerimeterConfiguration.md) +Gets effective NetworkSecurityPerimeterConfiguration for association + +### [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-AzStorageTaskAssignment](Get-AzStorageTaskAssignment.md) +Get the storage task assignment properties + +### [Get-AzStorageTaskAssignmentInstancesReport](Get-AzStorageTaskAssignmentInstancesReport.md) +Fetch the report summary of a single storage task assignment's instances + +### [Get-AzStorageTaskAssignmentsInstancesReport](Get-AzStorageTaskAssignmentsInstancesReport.md) +Fetch the report summary of all the storage task assignments and instances in an account + +### [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-AzStorageCustomerStorageAccountInitiatedMigration](Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md) +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. + +### [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. + +### [Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration](Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md) +Refreshes any information about the association. + +### [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. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. + +### [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. + +### [New-AzStorageTaskAssignment](New-AzStorageTaskAssignment.md) +Asynchronously creates a new storage task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + +### [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. + +### [Remove-AzStorageTaskAssignment](Remove-AzStorageTaskAssignment.md) +Delete the storage task assignment sub-resource + +### [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. + +### [Update-AzStorageTaskAssignment](Update-AzStorageTaskAssignment.md) +Update storage task assignment properties + diff --git a/swaggerci/storage.DefaultTag/docs/Clear-AzStorageBlobContainerLegalHold.md b/swaggerci/storage.DefaultTag/docs/Clear-AzStorageBlobContainerLegalHold.md new file mode 100644 index 000000000000..b693a5937693 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Clear-AzStorageBlobContainerLegalHold.md @@ -0,0 +1,264 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.ILegalHold + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHold + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccount.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccount.md new file mode 100644 index 000000000000..9affdb4ee348 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccount.md @@ -0,0 +1,116 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageAccount + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountCustomerInitiatedMigration.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountCustomerInitiatedMigration.md new file mode 100644 index 000000000000..955cb345f0ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountCustomerInitiatedMigration.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountcustomerinitiatedmigration +schema: 2.0.0 +--- + +# Get-AzStorageAccountCustomerInitiatedMigration + +## SYNOPSIS +Gets the status of the ongoing migration for the specified storage account. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageAccountCustomerInitiatedMigration -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageAccountCustomerInitiatedMigration -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the status of the ongoing migration 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: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageAccountMigration + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountKey.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountKey.md new file mode 100644 index 000000000000..49a2830db927 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountKey.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageAccountKey + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountProperty.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountProperty.md new file mode 100644 index 000000000000..3b1d49dc19d9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountProperty.md @@ -0,0 +1,168 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageAccount + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountSas.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountSas.md new file mode 100644 index 000000000000..49552bdff51d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountSas.md @@ -0,0 +1,305 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IAccountSasParameters + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountServiceSas.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountServiceSas.md new file mode 100644 index 000000000000..abcee2525ebe --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageAccountServiceSas.md @@ -0,0 +1,459 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IServiceSasParameters + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainer.md new file mode 100644 index 000000000000..f45fa5508797 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainer.md @@ -0,0 +1,221 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobContainer + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItem + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..733bee5398b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IImmutabilityPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6f8dd30b3680 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,155 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobInventoryPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobService.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobService.md new file mode 100644 index 000000000000..b30f5b957b40 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobService.md @@ -0,0 +1,126 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobServiceProperty.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobServiceProperty.md new file mode 100644 index 000000000000..d62b1d3edf0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageBlobServiceProperty.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageDeletedAccount.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageDeletedAccount.md new file mode 100644 index 000000000000..5397491b153d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageDeletedAccount.md @@ -0,0 +1,151 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IDeletedAccount + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageEncryptionScope.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..d795707776d0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageEncryptionScope.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 ] + [-Filter ] [-Include ] [-Maxpagesize ] + [-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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 encryption scope 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, when specified, will list encryption scopes with the specific state. +Defaults to All + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude +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, specifies the maximum number of encryption scopes that will be included in the list response. + +```yaml +Type: System.Int32 +Parameter Sets: List +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: 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.Api20230501.IEncryptionScope + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileService.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileService.md new file mode 100644 index 000000000000..1cee45a3b2f4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileService.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IFileServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileServiceProperty.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileServiceProperty.md new file mode 100644 index 000000000000..4e868bbfedc6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileServiceProperty.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IFileServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileShare.md new file mode 100644 index 000000000000..0dc42dee108f --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageFileShare.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IFileShare + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUser.md new file mode 100644 index 000000000000..494899c6399d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUser.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 ] + [-Filter ] [-Include ] [-Maxpagesize ] [-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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 local user 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, when specified, will list local users enabled for the specific protocol. +Lists all users by default. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam +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, specifies the maximum number of local users that will be included in the list response. + +```yaml +Type: System.Int32 +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 +``` + +### -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.Api20230501.ILocalUser + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUserKey.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUserKey.md new file mode 100644 index 000000000000..cc609ee8f415 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageLocalUserKey.md @@ -0,0 +1,172 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ILocalUserKeys + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..e976b0b1e2e1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageManagementPolicy.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IManagementPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageNetworkSecurityPerimeterConfiguration.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageNetworkSecurityPerimeterConfiguration.md new file mode 100644 index 000000000000..296288d6293f --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageNetworkSecurityPerimeterConfiguration.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragenetworksecurityperimeterconfiguration +schema: 2.0.0 +--- + +# Get-AzStorageNetworkSecurityPerimeterConfiguration + +## SYNOPSIS +Gets effective NetworkSecurityPerimeterConfiguration for association + +## SYNTAX + +### List (Default) +``` +Get-AzStorageNetworkSecurityPerimeterConfiguration -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageNetworkSecurityPerimeterConfiguration -AccountName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageNetworkSecurityPerimeterConfiguration -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets effective NetworkSecurityPerimeterConfiguration for association + +## 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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 for Network Security Perimeter configuration + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: NetworkSecurityPerimeterConfigurationName + +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.Api20230501.INetworkSecurityPerimeterConfiguration + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..9ffacb2bb5d6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IObjectReplicationPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateEndpointConnection.md b/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..2f37c8675730 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IPrivateEndpointConnection + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateLinkResource.md b/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateLinkResource.md new file mode 100644 index 000000000000..d6f607714cb3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStoragePrivateLinkResource.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IPrivateLinkResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueue.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueue.md new file mode 100644 index 000000000000..dc3f5d23dc10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueue.md @@ -0,0 +1,201 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IListQueue + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueue + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueService.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueService.md new file mode 100644 index 000000000000..9ea6deab9776 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueService.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IQueueServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueServiceProperty.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueServiceProperty.md new file mode 100644 index 000000000000..25712966acf2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageQueueServiceProperty.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IQueueServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageSku.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageSku.md new file mode 100644 index 000000000000..0a8476005947 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageSku.md @@ -0,0 +1,91 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ISkuInformation + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTable.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTable.md new file mode 100644 index 000000000000..e0acbf366e00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTable.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ITable + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableService.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableService.md new file mode 100644 index 000000000000..f84d116d714b --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableService.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ITableServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableServiceProperty.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableServiceProperty.md new file mode 100644 index 000000000000..827ce5496948 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTableServiceProperty.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ITableServiceProperties + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..5cd711dac4c2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignment.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignment +schema: 2.0.0 +--- + +# Get-AzStorageTaskAssignment + +## SYNOPSIS +Get the storage task assignment properties + +## SYNTAX + +### List (Default) +``` +Get-AzStorageTaskAssignment -AccountName -ResourceGroupName [-SubscriptionId ] + [-Maxpagesize ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageTaskAssignment -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageTaskAssignment -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get the storage task assignment properties + +## 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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -Maxpagesize +Optional, specifies the maximum number of storage task assignment Ids to be included in the list 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 +The name of the storage task assignment within the specified resource group. +Storage task assignment 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: StorageTaskAssignmentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +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.Api20230501.IStorageTaskAssignment + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentInstancesReport.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentInstancesReport.md new file mode 100644 index 000000000000..89d27c0a77f1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentInstancesReport.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentinstancesreport +schema: 2.0.0 +--- + +# Get-AzStorageTaskAssignmentInstancesReport + +## SYNOPSIS +Fetch the report summary of a single storage task assignment's instances + +## SYNTAX + +``` +Get-AzStorageTaskAssignmentInstancesReport -AccountName -ResourceGroupName + -StorageTaskAssignmentName [-SubscriptionId ] [-Filter ] [-Maxpagesize ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Fetch the report summary of a single storage task assignment's instances + +## 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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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, it can be used to query using reporting properties. +See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Maxpagesize +Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + +```yaml +Type: System.String +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. +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 +``` + +### -StorageTaskAssignmentName +The name of the storage task assignment within the specified resource group. +Storage task assignment 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 +``` + +### -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.Api20230501.IStorageTaskReportInstance + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentsInstancesReport.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentsInstancesReport.md new file mode 100644 index 000000000000..9b12d698fc4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageTaskAssignmentsInstancesReport.md @@ -0,0 +1,157 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentsinstancesreport +schema: 2.0.0 +--- + +# Get-AzStorageTaskAssignmentsInstancesReport + +## SYNOPSIS +Fetch the report summary of all the storage task assignments and instances in an account + +## SYNTAX + +``` +Get-AzStorageTaskAssignmentsInstancesReport -AccountName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Maxpagesize ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Fetch the report summary of all the storage task assignments and instances in an 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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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, it can be used to query using reporting properties. +See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Maxpagesize +Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + +```yaml +Type: System.String +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. +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.Api20230501.IStorageTaskReportInstance + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Get-AzStorageUsage.md b/swaggerci/storage.DefaultTag/docs/Get-AzStorageUsage.md new file mode 100644 index 000000000000..626bf11b9838 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Get-AzStorageUsage.md @@ -0,0 +1,107 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IUsage + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md new file mode 100644 index 000000000000..34d33640e88e --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md new file mode 100644 index 000000000000..3c68614b7f73 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md @@ -0,0 +1,309 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragecustomerstorageaccountinitiatedmigration +schema: 2.0.0 +--- + +# Invoke-AzStorageCustomerStorageAccountInitiatedMigration + +## SYNOPSIS +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. + +## SYNTAX + +### CustomerExpanded (Default) +``` +Invoke-AzStorageCustomerStorageAccountInitiatedMigration -AccountName -ResourceGroupName + -StorageAccountMigrationDetailTargetSkuName [-SubscriptionId ] [-Name ] + [-Type ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Customer +``` +Invoke-AzStorageCustomerStorageAccountInitiatedMigration -AccountName -ResourceGroupName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CustomerViaIdentity +``` +Invoke-AzStorageCustomerStorageAccountInitiatedMigration -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CustomerViaIdentityExpanded +``` +Invoke-AzStorageCustomerStorageAccountInitiatedMigration -InputObject + -StorageAccountMigrationDetailTargetSkuName [-Name ] [-Type ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. + +## 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: Customer, CustomerExpanded +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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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: CustomerViaIdentity, CustomerViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +current value is 'default' for customer initiated migration + +```yaml +Type: System.String +Parameter Sets: CustomerExpanded, CustomerViaIdentityExpanded +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 +``` + +### -Parameter +The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration +Parameter Sets: Customer, CustomerViaIdentity +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: Customer, CustomerExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountMigrationDetailTargetSkuName +Target sku name for the account + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName +Parameter Sets: CustomerExpanded, CustomerViaIdentityExpanded +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: Customer, CustomerExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +SrpAccountMigrationType in ARM contract which is 'accountMigrations' + +```yaml +Type: System.String +Parameter Sets: CustomerExpanded, CustomerViaIdentityExpanded +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.Api20230501.IStorageAccountMigration + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..d068d02a71d6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md @@ -0,0 +1,304 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IImmutabilityPolicy + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md new file mode 100644 index 000000000000..fc62bf9435eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md @@ -0,0 +1,244 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseBlobContainer.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseBlobContainer.md new file mode 100644 index 000000000000..9746f3b4d0aa --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseBlobContainer.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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.LeaseContainerRequestAction +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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.ILeaseContainerRequest +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.Api20230501.ILeaseContainerRequest + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponse + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseFileShare.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseFileShare.md new file mode 100644 index 000000000000..06164fdf258c --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageLeaseFileShare.md @@ -0,0 +1,329 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.ILeaseShareRequest + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponse + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md new file mode 100644 index 000000000000..4fa988a84c5d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md new file mode 100644 index 000000000000..f716132cd9f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragereconcilenetworksecurityperimeterconfiguration +schema: 2.0.0 +--- + +# Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration + +## SYNOPSIS +Refreshes any information about the association. + +## SYNTAX + +### Reconcile (Default) +``` +Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration -AccountName + -NetworkSecurityPerimeterConfigurationName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### ReconcileViaIdentity +``` +Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Refreshes any information about the association. + +## 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: Reconcile +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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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: ReconcileViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NetworkSecurityPerimeterConfigurationName +The name for Network Security Perimeter configuration + +```yaml +Type: System.String +Parameter Sets: Reconcile +Aliases: + +Required: True +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 +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Reconcile +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: Reconcile +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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..e1ca1fb30281 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IImmutabilityPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageAccount.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageAccount.md new file mode 100644 index 000000000000..1294909910a3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageAccount.md @@ -0,0 +1,1034 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 ] [-EnableExtendedGroup] [-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 ] [-SasPolicyExpirationAction ] + [-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 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 +``` + +### -AllowCrossTenantReplication +Allow or disallow cross AAD tenant object replication. +Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. +The default interpretation is false for new accounts to follow best security practices 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 +``` + +### -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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -EnableExtendedGroup +Enables extended group support with 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 +``` + +### -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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. +Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + +```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 +``` + +### -SasPolicyExpirationAction +The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. +The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction +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.Api20230501.IStorageAccount + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageAccountKey.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageAccountKey.md new file mode 100644 index 000000000000..a36ae4d41456 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageAccountKey.md @@ -0,0 +1,227 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IStorageAccountRegenerateKeyParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKey + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainer.md new file mode 100644 index 000000000000..d92422ffafd4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainer.md @@ -0,0 +1,193 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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.Api20230501.IContainerProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobContainer + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..c31e711a736b --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IImmutabilityPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..2f0f039d4891 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,188 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IBlobInventoryPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageFileShare.md new file mode 100644 index 000000000000..6c565bec8c0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageFileShare.md @@ -0,0 +1,294 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IFileShare + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUser.md new file mode 100644 index 000000000000..f7f89dba0fdb --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUser.md @@ -0,0 +1,334 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. + +## SYNTAX + +``` +New-AzStorageLocalUser -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-AllowAclAuthorization] [-ExtendedGroup ] [-GroupId ] + [-HasSharedKey] [-HasSshKey] [-HasSshPassword] [-HomeDirectory ] [-IsNfSv3Enabled] + [-PermissionScope ] [-SshAuthorizedKey ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update the properties of a local user associated with the storage account. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. + +## 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 +``` + +### -AllowAclAuthorization +Indicates whether ACL authorization is allowed for this user. +Set it to false to disallow using ACL authorization. + +```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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -ExtendedGroup +Supplementary group membership. +Only applicable for local users enabled for NFSv3 access. + +```yaml +Type: System.Int32[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupId +An identifier for associating a group of users. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +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 +``` + +### -IsNfSv3Enabled +Indicates if the local user is enabled for access with NFSv3 protocol. + +```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 +``` + +### -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.Api20230501.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.Api20230501.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.Api20230501.ILocalUser + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUserPassword.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUserPassword.md new file mode 100644 index 000000000000..62593ad5dc3a --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageLocalUserPassword.md @@ -0,0 +1,197 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..780a3c4a4be4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageManagementPolicy.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IManagementPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..b34957ab0dd1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IObjectReplicationPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageQueue.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageQueue.md new file mode 100644 index 000000000000..98641cabda85 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageQueue.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageQueue + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageTable.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageTable.md new file mode 100644 index 000000000000..e36af9f01843 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageTable.md @@ -0,0 +1,187 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.ITable + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/New-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/docs/New-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..bb4bed71156b --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/New-AzStorageTaskAssignment.md @@ -0,0 +1,395 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/new-azstoragetaskassignment +schema: 2.0.0 +--- + +# New-AzStorageTaskAssignment + +## SYNOPSIS +Asynchronously creates a new storage task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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-AzStorageTaskAssignment -AccountName -Name -ResourceGroupName + -Description -Enabled -ReportPrefix -TaskId -TriggerType + [-SubscriptionId ] [-ParameterEndBy ] [-ParameterInterval ] + [-ParameterIntervalUnit ] [-ParameterStartFrom ] [-ParameterStartOn ] + [-TargetExcludePrefix ] [-TargetPrefix ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new storage task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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 + +### -AccountName +The name of the storage account within 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 +``` + +### -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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -Description +Text that describes the purpose of the storage task assignment + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Enabled +Whether the storage task assignment is enabled or not + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the storage task assignment within the specified resource group. +Storage task assignment 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: StorageTaskAssignmentName + +Required: True +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 +``` + +### -ParameterEndBy +When to end task execution. +This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterInterval +Run interval of task execution. +This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterIntervalUnit +Run interval unit of task execution. +This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterStartFrom +When to start task execution. +This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterStartOn +When to start task execution. +This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReportPrefix +The container prefix for the location of storage task assignment report + +```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. +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 +``` + +### -TargetExcludePrefix +List of object prefixes to be excluded from task execution. +If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetPrefix +Required list of object prefixes to be included for task execution + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskId +Id of the corresponding storage task + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TriggerType +The trigger type of the storage task assignment execution + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType +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.Api20230501.IStorageTaskAssignment + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/README.md b/swaggerci/storage.DefaultTag/docs/README.md new file mode 100644 index 000000000000..8a16d3ebf625 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.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.DefaultTag/docs/Remove-AzStorageAccount.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageAccount.md new file mode 100644 index 000000000000..e4c6fc2bc3c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageAccount.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainer.md new file mode 100644 index 000000000000..4aa191cd7867 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainer.md @@ -0,0 +1,212 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..3baff038ef6a --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,221 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IImmutabilityPolicy + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..9799c06093a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageFileShare.md new file mode 100644 index 000000000000..b5af69ddba0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageFileShare.md @@ -0,0 +1,250 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageLocalUser.md new file mode 100644 index 000000000000..33ef28af5686 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageLocalUser.md @@ -0,0 +1,212 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..bf91eb5e793d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageManagementPolicy.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..3ef35ca38538 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStoragePrivateEndpointConnection.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..b38ba75f32bc --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageQueue.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageQueue.md new file mode 100644 index 000000000000..fb39cfbd1b64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageQueue.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTable.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTable.md new file mode 100644 index 000000000000..b4a9ba4b36b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTable.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..7fbda290b211 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Remove-AzStorageTaskAssignment.md @@ -0,0 +1,242 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/remove-azstoragetaskassignment +schema: 2.0.0 +--- + +# Remove-AzStorageTaskAssignment + +## SYNOPSIS +Delete the storage task assignment sub-resource + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageTaskAssignment -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageTaskAssignment -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete the storage task assignment sub-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: Delete +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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 storage task assignment within the specified resource group. +Storage task assignment 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: StorageTaskAssignmentName + +Required: True +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 +``` + +### -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. +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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Restore-AzStorageAccountBlobRange.md b/swaggerci/storage.DefaultTag/docs/Restore-AzStorageAccountBlobRange.md new file mode 100644 index 000000000000..06973c8c501c --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Restore-AzStorageAccountBlobRange.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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.Api20230501.IBlobRestoreRange[] +Parameter Sets: RestoreExpanded, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IBlobRestoreParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Restore-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/docs/Restore-AzStorageFileShare.md new file mode 100644 index 000000000000..fc6839a5f9ad --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Restore-AzStorageFileShare.md @@ -0,0 +1,277 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IDeletedShare + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Revoke-AzStorageAccountUserDelegationKey.md b/swaggerci/storage.DefaultTag/docs/Revoke-AzStorageAccountUserDelegationKey.md new file mode 100644 index 000000000000..80b9f9dbf0b6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Revoke-AzStorageAccountUserDelegationKey.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Test-AzStorageAccountNameAvailability.md b/swaggerci/storage.DefaultTag/docs/Test-AzStorageAccountNameAvailability.md new file mode 100644 index 000000000000..7630da928d12 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Test-AzStorageAccountNameAvailability.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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.Api20230501.IStorageAccountCheckNameAvailabilityParameters +Parameter Sets: Check, CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageAccountCheckNameAvailabilityParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageAccount.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageAccount.md new file mode 100644 index 000000000000..d5fb54da48bf --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageAccount.md @@ -0,0 +1,981 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 ] [-EnableExtendedGroup] [-EnableHttpsTrafficOnly] + [-Encryption ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-ImmutabilityPolicyAllowProtectedAppendWrite] + [-ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ] + [-ImmutabilityPolicyState ] [-ImmutableStorageWithVersioningEnabled] + [-IsLocalUserEnabled] [-IsSftpEnabled] [-KeyPolicyKeyExpirationPeriodInDay ] [-Kind ] + [-LargeFileSharesState ] [-MinimumTlsVersion ] + [-NetworkRuleSetBypass ] [-NetworkRuleSetDefaultAction ] + [-NetworkRuleSetIPRule ] [-NetworkRuleSetResourceAccessRule ] + [-NetworkRuleSetVirtualNetworkRule ] [-PublicNetworkAccess ] + [-RoutingPreferencePublishInternetEndpoint] [-RoutingPreferencePublishMicrosoftEndpoint] + [-RoutingPreferenceRoutingChoice ] [-SasPolicyExpirationAction ] + [-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 ] [-EnableExtendedGroup] [-EnableHttpsTrafficOnly] + [-Encryption ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-ImmutabilityPolicyAllowProtectedAppendWrite] + [-ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ] + [-ImmutabilityPolicyState ] [-ImmutableStorageWithVersioningEnabled] + [-IsLocalUserEnabled] [-IsSftpEnabled] [-KeyPolicyKeyExpirationPeriodInDay ] [-Kind ] + [-LargeFileSharesState ] [-MinimumTlsVersion ] + [-NetworkRuleSetBypass ] [-NetworkRuleSetDefaultAction ] + [-NetworkRuleSetIPRule ] [-NetworkRuleSetResourceAccessRule ] + [-NetworkRuleSetVirtualNetworkRule ] [-PublicNetworkAccess ] + [-RoutingPreferencePublishInternetEndpoint] [-RoutingPreferencePublishMicrosoftEndpoint] + [-RoutingPreferenceRoutingChoice ] [-SasPolicyExpirationAction ] + [-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 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 +``` + +### -AllowCrossTenantReplication +Allow or disallow cross AAD tenant object replication. +Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. +The default interpretation is false for new accounts to follow best security practices 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 +``` + +### -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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -EnableExtendedGroup +Enables extended group support with 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 +``` + +### -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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IVirtualNetworkRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. +Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + +```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 +``` + +### -SasPolicyExpirationAction +The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. +The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction +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.Api20230501.IStorageAccount + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageBlobContainer.md new file mode 100644 index 000000000000..5cac9e81a00f --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageBlobContainer.md @@ -0,0 +1,218 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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.Api20230501.IContainerProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IBlobContainer + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageEncryptionScope.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..0703137ee6c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageEncryptionScope.md @@ -0,0 +1,299 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IEncryptionScope + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageFileShare.md new file mode 100644 index 000000000000..aeb7af3bb333 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageFileShare.md @@ -0,0 +1,305 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.IFileShare + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageQueue.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageQueue.md new file mode 100644 index 000000000000..c95d89f0e67d --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageQueue.md @@ -0,0 +1,211 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.IStorageQueue + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageTable.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageTable.md new file mode 100644 index 000000000000..5ce3eff9aa07 --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageTable.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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.Api20230501.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.Api20230501.ITable + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/docs/Update-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/docs/Update-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..039b80b3520e --- /dev/null +++ b/swaggerci/storage.DefaultTag/docs/Update-AzStorageTaskAssignment.md @@ -0,0 +1,404 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://learn.microsoft.com/powershell/module/az.storage/update-azstoragetaskassignment +schema: 2.0.0 +--- + +# Update-AzStorageTaskAssignment + +## SYNOPSIS +Update storage task assignment properties + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageTaskAssignment -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-Description ] [-Enabled] [-ParameterEndBy ] + [-ParameterInterval ] [-ParameterIntervalUnit ] [-ParameterStartFrom ] + [-ParameterStartOn ] [-ReportPrefix ] [-TargetExcludePrefix ] + [-TargetPrefix ] [-TriggerType ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageTaskAssignment -InputObject [-Description ] [-Enabled] + [-ParameterEndBy ] [-ParameterInterval ] [-ParameterIntervalUnit ] + [-ParameterStartFrom ] [-ParameterStartOn ] [-ReportPrefix ] + [-TargetExcludePrefix ] [-TargetPrefix ] [-TriggerType ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update storage task assignment properties + +## 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 +``` + +### -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 DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```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 +``` + +### -Description +Text that describes the purpose of the storage task assignment + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Enabled +Whether the storage task assignment is enabled or not + +```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 +``` + +### -Name +The name of the storage task assignment within the specified resource group. +Storage task assignment 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: StorageTaskAssignmentName + +Required: True +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 +``` + +### -ParameterEndBy +When to end task execution. +This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterInterval +Run interval of task execution. +This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterIntervalUnit +Run interval unit of task execution. +This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterStartFrom +When to start task execution. +This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParameterStartOn +When to start task execution. +This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReportPrefix +The prefix of the storage task assignment report + +```yaml +Type: System.String +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. +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 +``` + +### -TargetExcludePrefix +List of object prefixes to be excluded from task execution. +If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetPrefix +Required list of object prefixes to be included for task execution + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TriggerType +The trigger type of the storage task assignment execution + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType +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.Api20230501.IStorageTaskAssignment + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/storage.DefaultTag/examples/Clear-AzStorageBlobContainerLegalHold.md b/swaggerci/storage.DefaultTag/examples/Clear-AzStorageBlobContainerLegalHold.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageAccount.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageAccountCustomerInitiatedMigration.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountCustomerInitiatedMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountCustomerInitiatedMigration.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.DefaultTag/examples/Get-AzStorageAccountKey.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageAccountProperty.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageAccountSas.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountSas.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageAccountServiceSas.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageAccountServiceSas.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageBlobService.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageBlobService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageBlobServiceProperty.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageBlobServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageDeletedAccount.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageDeletedAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageEncryptionScope.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageFileService.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageFileService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageFileServiceProperty.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageFileServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageLocalUserKey.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageLocalUserKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageNetworkSecurityPerimeterConfiguration.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageNetworkSecurityPerimeterConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Get-AzStorageNetworkSecurityPerimeterConfiguration.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.DefaultTag/examples/Get-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStoragePrivateEndpointConnection.md b/swaggerci/storage.DefaultTag/examples/Get-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStoragePrivateLinkResource.md b/swaggerci/storage.DefaultTag/examples/Get-AzStoragePrivateLinkResource.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageQueue.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageQueueService.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageQueueService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageQueueServiceProperty.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageQueueServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageSku.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageSku.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageTable.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageTableService.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTableService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageTableServiceProperty.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTableServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Get-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignment.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.DefaultTag/examples/Get-AzStorageTaskAssignmentInstancesReport.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignmentInstancesReport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignmentInstancesReport.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.DefaultTag/examples/Get-AzStorageTaskAssignmentsInstancesReport.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignmentsInstancesReport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Get-AzStorageTaskAssignmentsInstancesReport.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.DefaultTag/examples/Get-AzStorageUsage.md b/swaggerci/storage.DefaultTag/examples/Get-AzStorageUsage.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.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.DefaultTag/examples/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageLeaseBlobContainer.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageLeaseBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageLeaseFileShare.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageLeaseFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageObjectBlobContainerLevelWorm.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageObjectBlobContainerLevelWorm.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.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.DefaultTag/examples/Lock-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/examples/Lock-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageAccount.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageAccountKey.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageAccountKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageLocalUserPassword.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageLocalUserPassword.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageQueue.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageTable.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/New-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/examples/New-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/New-AzStorageTaskAssignment.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.DefaultTag/examples/Remove-AzStorageAccount.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageBlobInventoryPolicy.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageLocalUser.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageManagementPolicy.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageObjectReplicationPolicy.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStoragePrivateEndpointConnection.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageQueue.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageTable.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Remove-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Remove-AzStorageTaskAssignment.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.DefaultTag/examples/Restore-AzStorageAccountBlobRange.md b/swaggerci/storage.DefaultTag/examples/Restore-AzStorageAccountBlobRange.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Restore-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/examples/Restore-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Revoke-AzStorageAccountUserDelegationKey.md b/swaggerci/storage.DefaultTag/examples/Revoke-AzStorageAccountUserDelegationKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Test-AzStorageAccountNameAvailability.md b/swaggerci/storage.DefaultTag/examples/Test-AzStorageAccountNameAvailability.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageAccount.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageBlobContainer.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageEncryptionScope.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageFileShare.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageQueue.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageTable.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/examples/Update-AzStorageTaskAssignment.md b/swaggerci/storage.DefaultTag/examples/Update-AzStorageTaskAssignment.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage.DefaultTag/examples/Update-AzStorageTaskAssignment.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.DefaultTag/export-surface.ps1 b/swaggerci/storage.DefaultTag/export-surface.ps1 new file mode 100644 index 000000000000..90779898eaf3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/exports/Clear-AzStorageBlobContainerLegalHold.ps1 b/swaggerci/storage.DefaultTag/exports/Clear-AzStorageBlobContainerLegalHold.ps1 new file mode 100644 index 000000000000..092eae0b50b2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Clear-AzStorageBlobContainerLegalHold.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.ILegalHold +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/clear-azstorageblobcontainerlegalhold +#> +function Clear-AzStorageBlobContainerLegalHold { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccount.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccount.ps1 new file mode 100644 index 000000000000..6336d6c4ad42 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccount.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.IStorageAccount +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccount +#> +function Get-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccountCustomerInitiatedMigration.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountCustomerInitiatedMigration.ps1 new file mode 100644 index 000000000000..0abe1accf8e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountCustomerInitiatedMigration.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 +Gets the status of the ongoing migration for the specified storage account. +.Description +Gets the status of the ongoing migration for 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.Api20230501.IStorageAccountMigration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountcustomerinitiatedmigration +#> +function Get-AzStorageAccountCustomerInitiatedMigration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration])] +[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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageAccountCustomerInitiatedMigration_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageAccountCustomerInitiatedMigration_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccountKey.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountKey.ps1 new file mode 100644 index 000000000000..7048e07532f9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountKey.ps1 @@ -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. +# 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.Api20230501.IStorageAccountKey +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountkey +#> +function Get-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccountProperty.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountProperty.ps1 new file mode 100644 index 000000000000..db66ef40887b --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountProperty.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountproperty +#> +function Get-AzStorageAccountProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccountSas.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountSas.ps1 new file mode 100644 index 000000000000..f86327cebd46 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountSas.ps1 @@ -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. +# 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.Api20230501.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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageAccountServiceSas.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountServiceSas.ps1 new file mode 100644 index 000000000000..7cb52601ada7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageAccountServiceSas.ps1 @@ -0,0 +1,330 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageBlobContainer.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..9dd11ca3a70f --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobContainer.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 +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.Api20230501.IBlobContainer +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobcontainer +#> +function Get-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainer], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..93ba519cf997 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,239 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobcontainerimmutabilitypolicy +#> +function Get-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..4a2cb2344b0b --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobInventoryPolicy.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobinventorypolicy +#> +function Get-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageBlobService.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobService.ps1 new file mode 100644 index 000000000000..88cea7493c47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobService.ps1 @@ -0,0 +1,185 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IBlobServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobservice +#> +function Get-AzStorageBlobService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageBlobServiceProperty.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobServiceProperty.ps1 new file mode 100644 index 000000000000..5cec21793189 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageBlobServiceProperty.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobserviceproperty +#> +function Get-AzStorageBlobServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageDeletedAccount.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageDeletedAccount.ps1 new file mode 100644 index 000000000000..0cc8b4dee73d --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageDeletedAccount.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragedeletedaccount +#> +function Get-AzStorageDeletedAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageEncryptionScope.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageEncryptionScope.ps1 new file mode 100644 index 000000000000..5fe60101a33f --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageEncryptionScope.ps1 @@ -0,0 +1,257 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageencryptionscope +#> +function Get-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only encryption scope names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude] + # Optional, when specified, will list encryption scopes with the specific state. + # Defaults to All + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.Int32] + # Optional, specifies the maximum number of encryption scopes that will be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageFileService.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileService.ps1 new file mode 100644 index 000000000000..3365b8cf1905 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileService.ps1 @@ -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. +# 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.Api20230501.IFileServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileservice +#> +function Get-AzStorageFileService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageFileServiceProperty.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileServiceProperty.ps1 new file mode 100644 index 000000000000..7eb2f82ad778 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileServiceProperty.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceproperty +#> +function Get-AzStorageFileServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..aaf86639d1fc --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageFileShare.ps1 @@ -0,0 +1,266 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IFileShare +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileshare +#> +function Get-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShare], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageLocalUser.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..ee8167dacafe --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageLocalUser.ps1 @@ -0,0 +1,256 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragelocaluser +#> +function Get-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only local user names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam] + # Optional, when specified, will list local users enabled for the specific protocol. + # Lists all users by default. + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.Int32] + # Optional, specifies the maximum number of local users that will be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageLocalUserKey.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageLocalUserKey.ps1 new file mode 100644 index 000000000000..b708e137bc2f --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageLocalUserKey.ps1 @@ -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. +# 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.Api20230501.ILocalUserKeys +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragelocaluserkey +#> +function Get-AzStorageLocalUserKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageManagementPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..2077623e1783 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageManagementPolicy.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragemanagementpolicy +#> +function Get-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageNetworkSecurityPerimeterConfiguration.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageNetworkSecurityPerimeterConfiguration.ps1 new file mode 100644 index 000000000000..aa316383045a --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageNetworkSecurityPerimeterConfiguration.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 effective NetworkSecurityPerimeterConfiguration for association +.Description +Gets effective NetworkSecurityPerimeterConfiguration for association +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragenetworksecurityperimeterconfiguration +#> +function Get-AzStorageNetworkSecurityPerimeterConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration])] +[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('NetworkSecurityPerimeterConfigurationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name for Network Security Perimeter configuration + ${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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageNetworkSecurityPerimeterConfiguration_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageNetworkSecurityPerimeterConfiguration_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..6103971f787e --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageObjectReplicationPolicy.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageobjectreplicationpolicy +#> +function Get-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStoragePrivateEndpointConnection.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStoragePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..988756816cd6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStoragePrivateEndpointConnection.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 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageprivateendpointconnection +#> +function Get-AzStoragePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStoragePrivateLinkResource.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStoragePrivateLinkResource.ps1 new file mode 100644 index 000000000000..9aade4d44547 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStoragePrivateLinkResource.ps1 @@ -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. +# 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.Api20230501.IPrivateLinkResource +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageprivatelinkresource +#> +function Get-AzStoragePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageQueue.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueue.ps1 new file mode 100644 index 000000000000..9c4d6b861290 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueue.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IListQueue +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeue +#> +function Get-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueue], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageQueueService.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueueService.ps1 new file mode 100644 index 000000000000..2f19f10d6917 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueueService.ps1 @@ -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. +# 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.Api20230501.IQueueServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeueservice +#> +function Get-AzStorageQueueService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageQueueServiceProperty.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueueServiceProperty.ps1 new file mode 100644 index 000000000000..1c14de3ae31d --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageQueueServiceProperty.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeueserviceproperty +#> +function Get-AzStorageQueueServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageSku.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageSku.ps1 new file mode 100644 index 000000000000..40fd0c8119b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageSku.ps1 @@ -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. +# 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.Api20230501.ISkuInformation +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragesku +#> +function Get-AzStorageSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTable.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTable.ps1 new file mode 100644 index 000000000000..da32b5784204 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTable.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 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetable +#> +function Get-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTableService.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTableService.ps1 new file mode 100644 index 000000000000..e10f9b576d63 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTableService.ps1 @@ -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. +# 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.Api20230501.ITableServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetableservice +#> +function Get-AzStorageTableService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTableServiceProperty.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTableServiceProperty.ps1 new file mode 100644 index 000000000000..c3faa5264cba --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTableServiceProperty.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetableserviceproperty +#> +function Get-AzStorageTableServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTaskAssignment.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignment.ps1 new file mode 100644 index 000000000000..984427aea344 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignment.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 storage task assignment properties +.Description +Get the storage task assignment properties +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignment +#> +function Get-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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, specifies the maximum number of storage task assignment Ids to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTaskAssignment_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageTaskAssignment_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTaskAssignmentInstancesReport.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignmentInstancesReport.ps1 new file mode 100644 index 000000000000..1e6fddc6172d --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignmentInstancesReport.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Fetch the report summary of a single storage task assignment's instances +.Description +Fetch the report summary of a single storage task assignment's instances +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentinstancesreport +#> +function Get-AzStorageTaskAssignmentInstancesReport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance])] +[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. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${StorageTaskAssignmentName}, + + [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. + # When specified, it can be used to query using reporting properties. + # See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignmentInstancesReport_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageTaskAssignmentsInstancesReport.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignmentsInstancesReport.ps1 new file mode 100644 index 000000000000..4e0081edf617 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageTaskAssignmentsInstancesReport.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 +Fetch the report summary of all the storage task assignments and instances in an account +.Description +Fetch the report summary of all the storage task assignments and instances in an account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentsinstancesreport +#> +function Get-AzStorageTaskAssignmentsInstancesReport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance])] +[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. + # 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('Query')] + [System.String] + # Optional. + # When specified, it can be used to query using reporting properties. + # See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignmentsInstancesReport_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Get-AzStorageUsage.ps1 b/swaggerci/storage.DefaultTag/exports/Get-AzStorageUsage.ps1 new file mode 100644 index 000000000000..8316554b0fa7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Get-AzStorageUsage.ps1 @@ -0,0 +1,175 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IUsage +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageusage +#> +function Get-AzStorageUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 new file mode 100644 index 000000000000..cc7fa925cbb3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.ps1 new file mode 100644 index 000000000000..639835d202e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.ps1 @@ -0,0 +1,288 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. +.Description +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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 parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region. + DetailTargetSkuName : Target sku name for the account + [Name ]: current value is 'default' for customer initiated migration + [Type ]: SrpAccountMigrationType in ARM contract which is 'accountMigrations' +.Link +https://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragecustomerstorageaccountinitiatedmigration +#> +function Invoke-AzStorageCustomerStorageAccountInitiatedMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CustomerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Customer', Mandatory)] + [Parameter(ParameterSetName='CustomerExpanded', 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='Customer', Mandatory)] + [Parameter(ParameterSetName='CustomerExpanded', 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='Customer')] + [Parameter(ParameterSetName='CustomerExpanded')] + [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='CustomerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded', 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='Customer', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CustomerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration] + # The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CustomerExpanded', Mandatory)] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # Target sku name for the account + ${StorageAccountMigrationDetailTargetSkuName}, + + [Parameter(ParameterSetName='CustomerExpanded')] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # current value is 'default' for customer initiated migration + ${Name}, + + [Parameter(ParameterSetName='CustomerExpanded')] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # SrpAccountMigrationType in ARM contract which is 'accountMigrations' + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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 = @{ + Customer = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_Customer'; + CustomerExpanded = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded'; + CustomerViaIdentity = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity'; + CustomerViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded'; + } + if (('Customer', 'CustomerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..617a6637f177 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 @@ -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. +# 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.Api20230501.IImmutabilityPolicy +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageextendblobcontainerimmutabilitypolicy +#> +function Invoke-AzStorageExtendBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 new file mode 100644 index 000000000000..58136a937085 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 @@ -0,0 +1,249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageLeaseBlobContainer.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageLeaseBlobContainer.ps1 new file mode 100644 index 000000000000..d3676c62c858 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageLeaseBlobContainer.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.ILeaseContainerRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageleaseblobcontainer +#> +function Invoke-AzStorageLeaseBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILeaseContainerRequest] + # 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.LeaseContainerRequestAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction] + # 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageLeaseFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageLeaseFileShare.ps1 new file mode 100644 index 000000000000..14a624ccfe73 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageLeaseFileShare.ps1 @@ -0,0 +1,305 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.ILeaseShareRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageleasefileshare +#> +function Invoke-AzStorageLeaseFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.ps1 new file mode 100644 index 000000000000..7f474247e887 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.ps1 b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.ps1 new file mode 100644 index 000000000000..92a2f4c429bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Refreshes any information about the association. +.Description +Refreshes any information about the association. +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragereconcilenetworksecurityperimeterconfiguration +#> +function Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Reconcile', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reconcile', 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='Reconcile', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name for Network Security Perimeter configuration + ${NetworkSecurityPerimeterConfigurationName}, + + [Parameter(ParameterSetName='Reconcile', 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='Reconcile')] + [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='ReconcileViaIdentity', 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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 = @{ + Reconcile = 'Az.Storage.private\Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile'; + ReconcileViaIdentity = 'Az.Storage.private\Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity'; + } + if (('Reconcile') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..b3a5c617e73e --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/lock-azstorageblobcontainerimmutabilitypolicy +#> +function Lock-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageAccount.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageAccount.ps1 new file mode 100644 index 000000000000..4c7f317e65f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageAccount.ps1 @@ -0,0 +1,609 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageaccount +#> +function New-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. + # The default interpretation is false for new accounts to follow best security practices by default. + ${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] + # Enables extended group support with local users feature, if set to true + ${EnableExtendedGroup}, + + [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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + ${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()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction] + # The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. + # The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + ${SasPolicyExpirationAction}, + + [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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageAccountKey.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageAccountKey.ps1 new file mode 100644 index 000000000000..46b8bb456c1b --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageAccountKey.ps1 @@ -0,0 +1,249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IStorageAccountRegenerateKeyParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/new-azstorageaccountkey +#> +function New-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageBlobContainer.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..c9de48363f51 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobContainer.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 +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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobcontainer +#> +function New-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..a317b4a9a324 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.IImmutabilityPolicy +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobcontainerimmutabilitypolicy +#> +function New-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..69838a83fe1a --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageBlobInventoryPolicy.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.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. + [CreationTimeLastNDay ]: When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500. + [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://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobinventorypolicy +#> +function New-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..9d25f9a82bac --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageFileShare.ps1 @@ -0,0 +1,261 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstoragefileshare +#> +function New-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageLocalUser.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..3196c196f821 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageLocalUser.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 +Create or update the properties of a local user associated with the storage account. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. +.Description +Create or update the properties of a local user associated with the storage account. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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), Create (c), Modify Ownership (o), and Modify Permissions (p). + 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://learn.microsoft.com/powershell/module/az.storage/new-azstoragelocaluser +#> +function New-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 ACL authorization is allowed for this user. + # Set it to false to disallow using ACL authorization. + ${AllowAclAuthorization}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32[]] + # Supplementary group membership. + # Only applicable for local users enabled for NFSv3 access. + ${ExtendedGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # An identifier for associating a group of users. + ${GroupId}, + + [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()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if the local user is enabled for access with NFSv3 protocol. + ${IsNfSv3Enabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageLocalUserPassword.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageLocalUserPassword.ps1 new file mode 100644 index 000000000000..511485bef8ef --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageLocalUserPassword.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageManagementPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..55df929b6e95 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageManagementPolicy.ps1 @@ -0,0 +1,249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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. + [BaseBlob ]: The management policy action for base blob + [DeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [DeleteDaysAfterLastTierChangeGreaterThan ]: 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. + [DeleteDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [EnableAutoTierToHotFromCool ]: This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + [TierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [TierToArchiveDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToArchiveDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [TierToColdDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToColdDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [TierToCoolDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToCoolDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [TierToHotDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToHotDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToHotDaysAfterModificationGreaterThan ]: 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. + [SnapshotTierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [SnapshotTierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToHotDaysAfterLastTierChangeGreaterThan ]: 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. + [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. + [VersionTierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [VersionTierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToHotDaysAfterLastTierChangeGreaterThan ]: 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://learn.microsoft.com/powershell/module/az.storage/new-azstoragemanagementpolicy +#> +function New-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..bae2c8105c09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageObjectReplicationPolicy.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageobjectreplicationpolicy +#> +function New-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageQueue.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageQueue.ps1 new file mode 100644 index 000000000000..74f9dacaec69 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageQueue.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 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.Api20230501.IStorageQueue +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstoragequeue +#> +function New-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageTable.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageTable.ps1 new file mode 100644 index 000000000000..f5485050e4f1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageTable.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstoragetable +#> +function New-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/New-AzStorageTaskAssignment.ps1 b/swaggerci/storage.DefaultTag/exports/New-AzStorageTaskAssignment.ps1 new file mode 100644 index 000000000000..b8151607885b --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/New-AzStorageTaskAssignment.ps1 @@ -0,0 +1,289 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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 task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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.Api20230501.IStorageTaskAssignment +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstoragetaskassignment +#> +function New-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Text that describes the purpose of the storage task assignment + ${Description}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the storage task assignment is enabled or not + ${Enabled}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The container prefix for the location of storage task assignment report + ${ReportPrefix}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Id of the corresponding storage task + ${TaskId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType] + # The trigger type of the storage task assignment execution + ${TriggerType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to end task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterEndBy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Run interval of task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterInterval}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit] + # Run interval unit of task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterIntervalUnit}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterStartFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + ${ParameterStartOn}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # List of object prefixes to be excluded from task execution. + # If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + ${TargetExcludePrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Required list of object prefixes to be included for task execution + ${TargetPrefix}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/storage.DefaultTag/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..43ff70fc803a --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,19249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.ILegalHold +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/clear-azstorageblobcontainerlegalhold +#> +function Clear-AzStorageBlobContainerLegalHold { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 status of the ongoing migration for the specified storage account. +.Description +Gets the status of the ongoing migration for 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.Api20230501.IStorageAccountMigration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountcustomerinitiatedmigration +#> +function Get-AzStorageAccountCustomerInitiatedMigration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration])] +[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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageAccountCustomerInitiatedMigration_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageAccountCustomerInitiatedMigration_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IStorageAccountKey +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountkey +#> +function Get-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccountproperty +#> +function Get-AzStorageAccountProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IStorageAccount +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccount +#> +function Get-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobcontainerimmutabilitypolicy +#> +function Get-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IBlobContainer +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobcontainer +#> +function Get-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainer], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobinventorypolicy +#> +function Get-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobserviceproperty +#> +function Get-AzStorageBlobServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IBlobServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageblobservice +#> +function Get-AzStorageBlobService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragedeletedaccount +#> +function Get-AzStorageDeletedAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageencryptionscope +#> +function Get-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only encryption scope names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude] + # Optional, when specified, will list encryption scopes with the specific state. + # Defaults to All + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.Int32] + # Optional, specifies the maximum number of encryption scopes that will be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceproperty +#> +function Get-AzStorageFileServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IFileServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileservice +#> +function Get-AzStorageFileService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IFileShare +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileshare +#> +function Get-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShare], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.ILocalUserKeys +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragelocaluserkey +#> +function Get-AzStorageLocalUserKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragelocaluser +#> +function Get-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only local user names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam] + # Optional, when specified, will list local users enabled for the specific protocol. + # Lists all users by default. + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.Int32] + # Optional, specifies the maximum number of local users that will be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragemanagementpolicy +#> +function Get-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 effective NetworkSecurityPerimeterConfiguration for association +.Description +Gets effective NetworkSecurityPerimeterConfiguration for association +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragenetworksecurityperimeterconfiguration +#> +function Get-AzStorageNetworkSecurityPerimeterConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration])] +[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('NetworkSecurityPerimeterConfigurationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name for Network Security Perimeter configuration + ${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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageNetworkSecurityPerimeterConfiguration_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageNetworkSecurityPerimeterConfiguration_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageobjectreplicationpolicy +#> +function Get-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstorageprivateendpointconnection +#> +function Get-AzStoragePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IPrivateLinkResource +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageprivatelinkresource +#> +function Get-AzStoragePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeueserviceproperty +#> +function Get-AzStorageQueueServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IQueueServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeueservice +#> +function Get-AzStorageQueueService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IListQueue +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragequeue +#> +function Get-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueue], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.ISkuInformation +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragesku +#> +function Get-AzStorageSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetableserviceproperty +#> +function Get-AzStorageTableServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.ITableServiceProperties +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetableservice +#> +function Get-AzStorageTableService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetable +#> +function Get-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 +Fetch the report summary of a single storage task assignment's instances +.Description +Fetch the report summary of a single storage task assignment's instances +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentinstancesreport +#> +function Get-AzStorageTaskAssignmentInstancesReport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance])] +[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. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${StorageTaskAssignmentName}, + + [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. + # When specified, it can be used to query using reporting properties. + # See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignmentInstancesReport_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 +Fetch the report summary of all the storage task assignments and instances in an account +.Description +Fetch the report summary of all the storage task assignments and instances in an account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignmentsinstancesreport +#> +function Get-AzStorageTaskAssignmentsInstancesReport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance])] +[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. + # 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('Query')] + [System.String] + # Optional. + # When specified, it can be used to query using reporting properties. + # See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, specifies the maximum number of storage task assignment instances to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignmentsInstancesReport_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 storage task assignment properties +.Description +Get the storage task assignment properties +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignment +#> +function Get-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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, specifies the maximum number of storage task assignment Ids to be included in the list response. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTaskAssignment_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageTaskAssignment_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IUsage +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageusage +#> +function Get-AzStorageUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. +.Description +Account Migration request can be triggered for a storage account to change its redundancy level. +The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. +Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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 parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region. + DetailTargetSkuName : Target sku name for the account + [Name ]: current value is 'default' for customer initiated migration + [Type ]: SrpAccountMigrationType in ARM contract which is 'accountMigrations' +.Link +https://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragecustomerstorageaccountinitiatedmigration +#> +function Invoke-AzStorageCustomerStorageAccountInitiatedMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CustomerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Customer', Mandatory)] + [Parameter(ParameterSetName='CustomerExpanded', 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='Customer', Mandatory)] + [Parameter(ParameterSetName='CustomerExpanded', 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='Customer')] + [Parameter(ParameterSetName='CustomerExpanded')] + [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='CustomerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded', 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='Customer', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CustomerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration] + # The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CustomerExpanded', Mandatory)] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # Target sku name for the account + ${StorageAccountMigrationDetailTargetSkuName}, + + [Parameter(ParameterSetName='CustomerExpanded')] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # current value is 'default' for customer initiated migration + ${Name}, + + [Parameter(ParameterSetName='CustomerExpanded')] + [Parameter(ParameterSetName='CustomerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # SrpAccountMigrationType in ARM contract which is 'accountMigrations' + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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 = @{ + Customer = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_Customer'; + CustomerExpanded = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded'; + CustomerViaIdentity = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity'; + CustomerViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded'; + } + if (('Customer', 'CustomerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IImmutabilityPolicy +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageextendblobcontainerimmutabilitypolicy +#> +function Invoke-AzStorageExtendBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.ILeaseContainerRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageleaseblobcontainer +#> +function Invoke-AzStorageLeaseBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILeaseContainerRequest] + # 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.LeaseContainerRequestAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction] + # 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.ILeaseShareRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstorageleasefileshare +#> +function Invoke-AzStorageLeaseFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 +Refreshes any information about the association. +.Description +Refreshes any information about the association. +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/invoke-azstoragereconcilenetworksecurityperimeterconfiguration +#> +function Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Reconcile', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reconcile', 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='Reconcile', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name for Network Security Perimeter configuration + ${NetworkSecurityPerimeterConfigurationName}, + + [Parameter(ParameterSetName='Reconcile', 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='Reconcile')] + [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='ReconcileViaIdentity', 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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 = @{ + Reconcile = 'Az.Storage.private\Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile'; + ReconcileViaIdentity = 'Az.Storage.private\Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity'; + } + if (('Reconcile') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/lock-azstorageblobcontainerimmutabilitypolicy +#> +function Lock-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IStorageAccountRegenerateKeyParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/new-azstorageaccountkey +#> +function New-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageaccount +#> +function New-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. + # The default interpretation is false for new accounts to follow best security practices by default. + ${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] + # Enables extended group support with local users feature, if set to true + ${EnableExtendedGroup}, + + [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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + ${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()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction] + # The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. + # The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + ${SasPolicyExpirationAction}, + + [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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IImmutabilityPolicy +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobcontainerimmutabilitypolicy +#> +function New-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobcontainer +#> +function New-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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. + [CreationTimeLastNDay ]: When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500. + [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://learn.microsoft.com/powershell/module/az.storage/new-azstorageblobinventorypolicy +#> +function New-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstoragefileshare +#> +function New-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. +.Description +Create or update the properties of a local user associated with the storage account. +Properties for NFSv3 enablement and extended groups cannot be set with other properties. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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), Create (c), Modify Ownership (o), and Modify Permissions (p). + 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://learn.microsoft.com/powershell/module/az.storage/new-azstoragelocaluser +#> +function New-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 ACL authorization is allowed for this user. + # Set it to false to disallow using ACL authorization. + ${AllowAclAuthorization}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32[]] + # Supplementary group membership. + # Only applicable for local users enabled for NFSv3 access. + ${ExtendedGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # An identifier for associating a group of users. + ${GroupId}, + + [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()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if the local user is enabled for access with NFSv3 protocol. + ${IsNfSv3Enabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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. + [BaseBlob ]: The management policy action for base blob + [DeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [DeleteDaysAfterLastTierChangeGreaterThan ]: 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. + [DeleteDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [EnableAutoTierToHotFromCool ]: This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + [TierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [TierToArchiveDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToArchiveDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [TierToColdDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToColdDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [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 + [TierToCoolDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToCoolDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [TierToHotDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToHotDaysAfterLastTierChangeGreaterThan ]: 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. + [TierToHotDaysAfterModificationGreaterThan ]: 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. + [SnapshotTierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [SnapshotTierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToHotDaysAfterLastTierChangeGreaterThan ]: 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. + [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. + [VersionTierToColdDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToColdDaysAfterLastTierChangeGreaterThan ]: 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. + [VersionTierToHotDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToHotDaysAfterLastTierChangeGreaterThan ]: 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://learn.microsoft.com/powershell/module/az.storage/new-azstoragemanagementpolicy +#> +function New-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstorageobjectreplicationpolicy +#> +function New-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IStorageQueue +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstoragequeue +#> +function New-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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://learn.microsoft.com/powershell/module/az.storage/new-azstoragetable +#> +function New-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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 task assignment sub-resource with the specified parameters. +If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. +If a storage task assignment 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.Api20230501.IStorageTaskAssignment +.Link +https://learn.microsoft.com/powershell/module/az.storage/new-azstoragetaskassignment +#> +function New-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Text that describes the purpose of the storage task assignment + ${Description}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the storage task assignment is enabled or not + ${Enabled}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The container prefix for the location of storage task assignment report + ${ReportPrefix}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Id of the corresponding storage task + ${TaskId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType] + # The trigger type of the storage task assignment execution + ${TriggerType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to end task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterEndBy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Run interval of task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterInterval}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit] + # Run interval unit of task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterIntervalUnit}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterStartFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + ${ParameterStartOn}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # List of object prefixes to be excluded from task execution. + # If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + ${TargetExcludePrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Required list of object prefixes to be included for task execution + ${TargetPrefix}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/remove-azstorageblobcontainerimmutabilitypolicy +#> +function Remove-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 +Delete the storage task assignment sub-resource +.Description +Delete the storage task assignment sub-resource +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/remove-azstoragetaskassignment +#> +function Remove-AzStorageTaskAssignment { +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageTaskAssignment_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IBlobRestoreParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/restore-azstorageaccountblobrange +#> +function Restore-AzStorageAccountBlobRange { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IStorageAccountCheckNameAvailabilityParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/test-azstorageaccountnameavailability +#> +function Test-AzStorageAccountNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageaccount +#> +function Update-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. + # The default interpretation is false for new accounts to follow best security practices by default. + ${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] + # Enables extended group support with local users feature, if set to true + ${EnableExtendedGroup}, + + [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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + ${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()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction] + # The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. + # The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + ${SasPolicyExpirationAction}, + + [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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageblobcontainer +#> +function Update-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.IEncryptionScope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageencryptionscope +#> +function Update-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragefileshare +#> +function Update-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragequeue +#> +function Update-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragetable +#> +function Update-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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 storage task assignment properties +.Description +Update storage task assignment properties +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragetaskassignment +#> +function Update-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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')] + [System.String] + # Text that describes the purpose of the storage task assignment + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the storage task assignment is enabled or not + ${Enabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to end task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterEndBy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Run interval of task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterInterval}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit] + # Run interval unit of task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterIntervalUnit}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterStartFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + ${ParameterStartOn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The prefix of the storage task assignment report + ${ReportPrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # List of object prefixes to be excluded from task execution. + # If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + ${TargetExcludePrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Required list of object prefixes to be included for task execution + ${TargetPrefix}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType] + # The trigger type of the storage task assignment execution + ${TriggerType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageTaskAssignment_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/README.md b/swaggerci/storage.DefaultTag/exports/README.md new file mode 100644 index 000000000000..1d26e02736c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.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.DefaultTag/exports/Remove-AzStorageAccount.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageAccount.ps1 new file mode 100644 index 000000000000..0d52a901cace --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageAccount.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageBlobContainer.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..9db985dfa9b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobContainer.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..94dc056e03ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/remove-azstorageblobcontainerimmutabilitypolicy +#> +function Remove-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..6264602c76a1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageBlobInventoryPolicy.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..d8a975ceac7a --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageFileShare.ps1 @@ -0,0 +1,256 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageLocalUser.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..1c6eae6fa1be --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageLocalUser.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageManagementPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..ab01278d90a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageManagementPolicy.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..8de50bfca8fe --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageObjectReplicationPolicy.ps1 @@ -0,0 +1,239 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStoragePrivateEndpointConnection.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStoragePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..ea0e5b5179bf --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStoragePrivateEndpointConnection.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageQueue.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageQueue.ps1 new file mode 100644 index 000000000000..539eb34f81f1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageQueue.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageTable.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageTable.ps1 new file mode 100644 index 000000000000..1ee5da1a1f96 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageTable.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Remove-AzStorageTaskAssignment.ps1 b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageTaskAssignment.ps1 new file mode 100644 index 000000000000..1eff03eb1ea3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Remove-AzStorageTaskAssignment.ps1 @@ -0,0 +1,249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Delete the storage task assignment sub-resource +.Description +Delete the storage task assignment sub-resource +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/remove-azstoragetaskassignment +#> +function Remove-AzStorageTaskAssignment { +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageTaskAssignment_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Restore-AzStorageAccountBlobRange.ps1 b/swaggerci/storage.DefaultTag/exports/Restore-AzStorageAccountBlobRange.ps1 new file mode 100644 index 000000000000..963b5c082168 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Restore-AzStorageAccountBlobRange.ps1 @@ -0,0 +1,277 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IBlobRestoreParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/restore-azstorageaccountblobrange +#> +function Restore-AzStorageAccountBlobRange { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Restore-AzStorageFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/Restore-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..44e2e25ff298 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Restore-AzStorageFileShare.ps1 @@ -0,0 +1,274 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Revoke-AzStorageAccountUserDelegationKey.ps1 b/swaggerci/storage.DefaultTag/exports/Revoke-AzStorageAccountUserDelegationKey.ps1 new file mode 100644 index 000000000000..9f96b5b645e1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Revoke-AzStorageAccountUserDelegationKey.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 +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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Test-AzStorageAccountNameAvailability.ps1 b/swaggerci/storage.DefaultTag/exports/Test-AzStorageAccountNameAvailability.ps1 new file mode 100644 index 000000000000..87def0e0d4ea --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Test-AzStorageAccountNameAvailability.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.IStorageAccountCheckNameAvailabilityParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/test-azstorageaccountnameavailability +#> +function Test-AzStorageAccountNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageAccount.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageAccount.ps1 new file mode 100644 index 000000000000..816bf735b086 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageAccount.ps1 @@ -0,0 +1,609 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageaccount +#> +function Update-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. + # The default interpretation is false for new accounts to follow best security practices by default. + ${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] + # Enables extended group support with local users feature, if set to true + ${EnableExtendedGroup}, + + [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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + ${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()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction] + # The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. + # The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + ${SasPolicyExpirationAction}, + + [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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageBlobContainer.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..1794fd7e9a63 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageBlobContainer.ps1 @@ -0,0 +1,257 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageblobcontainer +#> +function Update-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageEncryptionScope.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageEncryptionScope.ps1 new file mode 100644 index 000000000000..c3b0fba500f8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageEncryptionScope.ps1 @@ -0,0 +1,290 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.IEncryptionScope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstorageencryptionscope +#> +function Update-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageFileShare.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..0d46762ab4b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageFileShare.ps1 @@ -0,0 +1,289 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragefileshare +#> +function Update-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageQueue.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageQueue.ps1 new file mode 100644 index 000000000000..697428b6659b --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageQueue.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragequeue +#> +function Update-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageTable.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageTable.ps1 new file mode 100644 index 000000000000..6e86617d216f --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageTable.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 +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.Api20230501.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragetable +#> +function Update-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/exports/Update-AzStorageTaskAssignment.ps1 b/swaggerci/storage.DefaultTag/exports/Update-AzStorageTaskAssignment.ps1 new file mode 100644 index 000000000000..dafd85354c79 --- /dev/null +++ b/swaggerci/storage.DefaultTag/exports/Update-AzStorageTaskAssignment.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 +Update storage task assignment properties +.Description +Update storage task assignment properties +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment +.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' + [MigrationName ]: The name of the Storage Account Migration. It should always be 'default' + [NetworkSecurityPerimeterConfigurationName ]: The name for Network Security Perimeter configuration + [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. + [StorageTaskAssignmentName ]: The name of the storage task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [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://learn.microsoft.com/powershell/module/az.storage/update-azstoragetaskassignment +#> +function Update-AzStorageTaskAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment])] +[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('StorageTaskAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage task assignment within the specified resource group. + # Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group. + # 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')] + [System.String] + # Text that describes the purpose of the storage task assignment + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the storage task assignment is enabled or not + ${Enabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to end task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterEndBy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Run interval of task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterInterval}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit] + # Run interval unit of task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterIntervalUnit}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + ${ParameterStartFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # When to start task execution. + # This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + ${ParameterStartOn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The prefix of the storage task assignment report + ${ReportPrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # List of object prefixes to be excluded from task execution. + # If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor + ${TargetExcludePrefix}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Required list of object prefixes to be included for task execution + ${TargetPrefix}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType] + # The trigger type of the storage task assignment execution + ${TriggerType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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 = $PSVersionTable.PSVersion.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-AzStorageTaskAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageTaskAssignment_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $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.DefaultTag/generate-help.ps1 b/swaggerci/storage.DefaultTag/generate-help.ps1 new file mode 100644 index 000000000000..708081a0e9c7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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 + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generate-portal-ux.ps1 b/swaggerci/storage.DefaultTag/generate-portal-ux.ps1 new file mode 100644 index 000000000000..c0c8577a13e6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generate-portal-ux.ps1 @@ -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. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +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 +} + +$moduleName = 'Az.Storage' +$rootModuleName = '' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.Storage.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet") + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If ($buildinfunctions.Contains($FunctionName)) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/Module.cs b/swaggerci/storage.DefaultTag/generated/Module.cs new file mode 100644 index 000000000000..f185cf7a71e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/Module.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 +{ + 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>; + using SanitizerDelegate = global::System.Action; + using GetTelemetryInfoDelegate = global::System.Func>; + + /// 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; } + + /// The delegate to get the telemetry info. + public GetTelemetryInfoDelegate GetTelemetryInfo { 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 to call in WriteObject to sanitize the output object. + public SanitizerDelegate SanitizeOutput { get; set; } + + /// 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.DefaultTag/generated/api/Models/Any.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..92a9cfd3d9fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Any.PowerShell.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// 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 Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(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.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(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.IAny 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(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Any.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..8008d03c9ad8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Any.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : 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.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.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.DefaultTag/generated/api/Models/Any.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Any.cs new file mode 100644 index 000000000000..b172eaa804c6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Any.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. +// Code generated by Microsoft (R) 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; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Any.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..2ae0c9b3e9d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Any.json.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// 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 Any(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Any(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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api10/AzureEntityResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/AzureEntityResource.PowerShell.cs new file mode 100644 index 000000000000..dbd975b6f4aa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/AzureEntityResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/AzureEntityResource.TypeConverter.cs new file mode 100644 index 000000000000..a0b16f0dc8e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/AzureEntityResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/AzureEntityResource.cs new file mode 100644 index 000000000000..1d429ac319c6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/AzureEntityResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/AzureEntityResource.json.cs new file mode 100644 index 000000000000..602cf80cd0d0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/ProxyResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..794c70798cf5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/ProxyResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..d7775b540f33 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/ProxyResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/ProxyResource.cs new file mode 100644 index 000000000000..49d0f0c72b9e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/ProxyResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/ProxyResource.json.cs new file mode 100644 index 000000000000..ed3f78ca5000 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/Resource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/Resource.PowerShell.cs new file mode 100644 index 000000000000..713c8c561ecb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/Resource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/Resource.TypeConverter.cs new file mode 100644 index 000000000000..b66223452700 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/Resource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/Resource.cs new file mode 100644 index 000000000000..34ac07d6a308 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/Resource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/Resource.json.cs new file mode 100644 index 000000000000..f4dcf8acff51 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..d53d73253b75 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..4fe3a4a45488 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResource.cs new file mode 100644 index 000000000000..ed9424f8f92a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResource.json.cs new file mode 100644 index 000000000000..96638ee0210c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..ffd91806a208 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..b8cd90fb38e8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.cs new file mode 100644 index 000000000000..48a46e99ddb8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..91bfed0047b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api10/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..25b2e105a559 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api20/SystemData.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20/SystemData.PowerShell.cs new file mode 100644 index 000000000000..9dba1cfa6a84 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api20/SystemData.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..db7143b1093a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api20/SystemData.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20/SystemData.cs new file mode 100644 index 000000000000..2f03150617ec --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api20/SystemData.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20/SystemData.json.cs new file mode 100644 index 000000000000..af97539b53b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.PowerShell.cs new file mode 100644 index 000000000000..6d5abb90d6c7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.TypeConverter.cs new file mode 100644 index 000000000000..f2827d305296 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccessPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.cs new file mode 100644 index 000000000000..5710d9991682 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class AccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccessPolicy.json.cs new file mode 100644 index 000000000000..a47cb5d73ab3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccessPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..2c99f4db2217 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..6fa73b064c60 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountImmutabilityPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.cs new file mode 100644 index 000000000000..ba0433d3c9a3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountImmutabilityPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountImmutabilityPolicyProperties.json.cs new file mode 100644 index 000000000000..036efe2a197b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountImmutabilityPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.PowerShell.cs new file mode 100644 index 000000000000..bb7de1d78072 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountSasParametersInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).ResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).ResourceType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountSasParametersInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).ResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).ResourceType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.TypeConverter.cs new file mode 100644 index 000000000000..0d45d9724276 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountSasParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.cs new file mode 100644 index 000000000000..b3da244b2725 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountSasParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AccountSasParameters.json.cs new file mode 100644 index 000000000000..08e741baebf9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAccountSasParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountSasParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.PowerShell.cs new file mode 100644 index 000000000000..41863ef844e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("NetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName = (string) content.GetValueForProperty("NetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).ForestName = (string) content.GetValueForProperty("ForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).ForestName, global::System.Convert.ToString); + } + if (content.Contains("DomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainGuid = (string) content.GetValueForProperty("DomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainGuid, global::System.Convert.ToString); + } + if (content.Contains("DomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainSid = (string) content.GetValueForProperty("DomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainSid, global::System.Convert.ToString); + } + if (content.Contains("AzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid = (string) content.GetValueForProperty("AzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("SamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).SamAccountName = (string) content.GetValueForProperty("SamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).SamAccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("NetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName = (string) content.GetValueForProperty("NetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).ForestName = (string) content.GetValueForProperty("ForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).ForestName, global::System.Convert.ToString); + } + if (content.Contains("DomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainGuid = (string) content.GetValueForProperty("DomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainGuid, global::System.Convert.ToString); + } + if (content.Contains("DomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainSid = (string) content.GetValueForProperty("DomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).DomainSid, global::System.Convert.ToString); + } + if (content.Contains("AzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid = (string) content.GetValueForProperty("AzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("SamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).SamAccountName = (string) content.GetValueForProperty("SamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).SamAccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.TypeConverter.cs new file mode 100644 index 000000000000..a7a75e047c72 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IActiveDirectoryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.cs new file mode 100644 index 000000000000..1f69778035c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IActiveDirectoryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ActiveDirectoryProperties.json.cs new file mode 100644 index 000000000000..2ff24a9d1720 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IActiveDirectoryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.PowerShell.cs new file mode 100644 index 000000000000..db8423c657d6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("ActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("DirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("DefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("DefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("ActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("DirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("DefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("DefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.TypeConverter.cs new file mode 100644 index 000000000000..9eb6f560154b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAzureFilesIdentityBasedAuthentication ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.cs new file mode 100644 index 000000000000..e341f831b32f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IAzureFilesIdentityBasedAuthentication, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryProperties ActiveDirectoryProperty { get => (this._activeDirectoryProperty = this._activeDirectoryProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).ForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).NetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).SamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal.ActiveDirectoryProperty { get => (this._activeDirectoryProperty = this._activeDirectoryProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/AzureFilesIdentityBasedAuthentication.json.cs new file mode 100644 index 000000000000..4dfcaac1c23e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthentication. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobContainer.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobContainer.PowerShell.cs new file mode 100644 index 000000000000..1b1b289a838a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobContainerInternal)this).ContainerProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties) content.GetValueForProperty("ContainerProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainerInternal)this).ContainerProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobContainerInternal)this).ContainerProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties) content.GetValueForProperty("ContainerProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainerInternal)this).ContainerProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobContainer.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobContainer.TypeConverter.cs new file mode 100644 index 000000000000..376e3787c679 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobContainer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobContainer.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobContainer.cs new file mode 100644 index 000000000000..559236eb1d4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobContainer, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IContainerProperties ContainerProperty { get => (this._containerProperty = this._containerProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerProperties ContainerProperty { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobContainer.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobContainer.json.cs new file mode 100644 index 000000000000..ec41fb7b77eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ContainerProperties.FromJson(__jsonProperties) : ContainerProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.PowerShell.cs new file mode 100644 index 000000000000..82288a3ac75b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + /// + [System.ComponentModel.TypeConverter(typeof(BlobInventoryCreationTimeTypeConverter))] + public partial class BlobInventoryCreationTime + { + + /// + /// 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 BlobInventoryCreationTime(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)this).LastNDay = (int?) content.GetValueForProperty("LastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)this).LastNDay, (__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 BlobInventoryCreationTime(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)this).LastNDay = (int?) content.GetValueForProperty("LastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)this).LastNDay, (__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.Api20230501.IBlobInventoryCreationTime DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryCreationTime(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.Api20230501.IBlobInventoryCreationTime DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryCreationTime(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.Api20230501.IBlobInventoryCreationTime 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 property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryCreationTimeTypeConverter))] + public partial interface IBlobInventoryCreationTime + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.TypeConverter.cs new file mode 100644 index 000000000000..4077cc654247 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryCreationTimeTypeConverter : 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.Api20230501.IBlobInventoryCreationTime ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryCreationTime.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryCreationTime.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryCreationTime.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.cs new file mode 100644 index 000000000000..798f2626f774 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.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.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + /// + public partial class BlobInventoryCreationTime : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal + { + + /// Backing field for property. + private int? _lastNDay; + + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? LastNDay { get => this._lastNDay; set => this._lastNDay = value; } + + /// Creates an new instance. + public BlobInventoryCreationTime() + { + + } + } + /// This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + public partial interface IBlobInventoryCreationTime : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.", + SerializedName = @"lastNDays", + PossibleTypes = new [] { typeof(int) })] + int? LastNDay { get; set; } + + } + /// This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + internal partial interface IBlobInventoryCreationTimeInternal + + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + int? LastNDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.json.cs new file mode 100644 index 000000000000..fdbc622fab5b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryCreationTime.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + /// mandatory with this filter. + /// + public partial class BlobInventoryCreationTime + { + + /// + /// 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 BlobInventoryCreationTime(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lastNDay = If( json?.PropertyT("lastNDays"), out var __jsonLastNDays) ? (int?)__jsonLastNDays : LastNDay;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryCreationTime(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._lastNDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._lastNDay) : null, "lastNDays" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.PowerShell.cs new file mode 100644 index 000000000000..b9bc248670bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.TypeConverter.cs new file mode 100644 index 000000000000..f19f20d1d1cd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.cs new file mode 100644 index 000000000000..43b895463f1f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicyInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).Policy = value; } + + /// Internal Acessors for PolicyDestination + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal.PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyDestination = value; } + + /// Internal Acessors for PolicyType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal.PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicy.json.cs new file mode 100644 index 000000000000..0667b55c6e79 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IBlobInventoryPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.PowerShell.cs new file mode 100644 index 000000000000..5cafdd7fccce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField = (string[]) content.GetValueForProperty("SchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("FilterCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).CreationTimeLastNDay, (__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 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.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField = (string[]) content.GetValueForProperty("SchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("FilterCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)this).CreationTimeLastNDay, (__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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.TypeConverter.cs new file mode 100644 index 000000000000..17deba347926 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.cs new file mode 100644 index 000000000000..463509bb30c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.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.Models.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal + { + + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? CreationTimeLastNDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).CreationTimeLastNDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).CreationTimeLastNDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).ExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).IncludeBlobVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).IncludeDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).IncludeSnapshot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilter()); set { {_filter = value;} } } + + /// Internal Acessors for FilterCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal.FilterCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)Filter).CreationTime = 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 + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.", + SerializedName = @"lastNDays", + PossibleTypes = new [] { typeof(int) })] + int? CreationTimeLastNDay { 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; } + /// 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 + + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + int? CreationTimeLastNDay { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// This property is used to filter objects based on the object creation time + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime FilterCreationTime { 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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyDefinition.json.cs new file mode 100644 index 000000000000..01bb2887df81 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..590472b80610 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion = (bool?) content.GetValueForProperty("IncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot = (bool?) content.GetValueForProperty("IncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted = (bool?) content.GetValueForProperty("IncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTimeLastNDay, (__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 BlobInventoryPolicyFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion = (bool?) content.GetValueForProperty("IncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot = (bool?) content.GetValueForProperty("IncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted = (bool?) content.GetValueForProperty("IncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal)this).CreationTimeLastNDay, (__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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..379bd283e609 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.cs new file mode 100644 index 000000000000..63f41e87f0bc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime _creationTime; + + /// This property is used to filter objects based on the object creation time + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime CreationTime { get => (this._creationTime = this._creationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTime()); set => this._creationTime = value; } + + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? CreationTimeLastNDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)CreationTime).LastNDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTimeInternal)CreationTime).LastNDay = value ?? default(int); } + + /// 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; } + + /// Internal Acessors for CreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilterInternal.CreationTime { get => (this._creationTime = this._creationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTime()); set { {_creationTime = 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; } + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.", + SerializedName = @"lastNDays", + PossibleTypes = new [] { typeof(int) })] + int? CreationTimeLastNDay { 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; } + /// This property is used to filter objects based on the object creation time + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime CreationTime { get; set; } + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + int? CreationTimeLastNDay { 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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.json.cs new file mode 100644 index 000000000000..da451f15b848 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyFilter.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.Api20230501 +{ + 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; + } + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTime.FromJson(__jsonCreationTime) : CreationTime;} + {_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.Api20230501.IBlobInventoryPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; + } + AddIf( null != this._creationTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._creationTime.ToJson(null,serializationMode) : null, "creationTime" ,container.Add ); + 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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..c5598e80c301 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..35f5beda1d13 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.cs new file mode 100644 index 000000000000..46df21a3703b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyPropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicySchema()); set { {_policy = value;} } } + + /// Internal Acessors for PolicyDestination + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal.PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Destination = value; } + + /// Internal Acessors for PolicyType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyPropertiesInternal.PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicySchema Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)Policy).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicyRule[] PolicyRule { get; set; } + /// The valid value is Inventory + string PolicyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyProperties.json.cs new file mode 100644 index 000000000000..ba00966124d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IBlobInventoryPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..06339d0e3dff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.PowerShell.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("DefinitionFormat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("DefinitionSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("DefinitionSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("DefinitionObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("DefinitionObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionSchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField = (string[]) content.GetValueForProperty("DefinitionSchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("FilterCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).CreationTimeLastNDay, (__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 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.Api20230501.IBlobInventoryPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("DefinitionFormat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("DefinitionSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("DefinitionSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("DefinitionObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("DefinitionObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionSchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField = (string[]) content.GetValueForProperty("DefinitionSchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime) content.GetValueForProperty("FilterCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationTimeLastNDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).CreationTimeLastNDay = (int?) content.GetValueForProperty("CreationTimeLastNDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal)this).CreationTimeLastNDay, (__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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..306bb9a65192 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.cs new file mode 100644 index 000000000000..6db2cf46394a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.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.Models.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal + { + + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? CreationTimeLastNDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).CreationTimeLastNDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).CreationTimeLastNDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).SchemaField; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterBlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeBlobVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeSnapshot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterPrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterPrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinition Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for DefinitionFilter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal.DefinitionFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).Filter = value; } + + /// Internal Acessors for FilterCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRuleInternal.FilterCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterCreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterCreationTime = 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 + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.", + SerializedName = @"lastNDays", + PossibleTypes = new [] { typeof(int) })] + int? CreationTimeLastNDay { 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 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 + + { + /// + /// When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to + /// 36500. + /// + int? CreationTimeLastNDay { get; set; } + /// An object that defines the blob inventory policy rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyDefinition Definition { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// This property is used to filter objects based on the object creation time + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryCreationTime FilterCreationTime { 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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicyRule.json.cs new file mode 100644 index 000000000000..f7a5d9af4114 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IBlobInventoryPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.PowerShell.cs new file mode 100644 index 000000000000..93d7272af998 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicySchemaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicySchemaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.TypeConverter.cs new file mode 100644 index 000000000000..219c70c64a34 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicySchema ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.cs new file mode 100644 index 000000000000..5e6fbd540011 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicySchema, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicySchemaInternal.Destination { get => this._destination; set { {_destination = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchemaInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicyRule[] Rule { get; set; } + /// The valid value is Inventory + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobInventoryPolicySchema.json.cs new file mode 100644 index 000000000000..3ccd2ef0df0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobInventoryPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobInventoryPolicyRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicySchema. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.PowerShell.cs new file mode 100644 index 000000000000..01529f720340 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreParametersInternal)this).TimeToRestore = (global::System.DateTime) content.GetValueForProperty("TimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParametersInternal)this).BlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("BlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParametersInternal)this).BlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParametersInternal)this).TimeToRestore = (global::System.DateTime) content.GetValueForProperty("TimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParametersInternal)this).BlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("BlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParametersInternal)this).BlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.TypeConverter.cs new file mode 100644 index 000000000000..6147f67f5c60 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.cs new file mode 100644 index 000000000000..4e1ca7481b0c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore parameters + public partial class BlobRestoreParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreParameters.json.cs new file mode 100644 index 000000000000..c54c096c08f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreRange) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRange.FromJson(__u) )) ))() : null : BlobRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.PowerShell.cs new file mode 100644 index 000000000000..a1d460459346 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreRangeInternal)this).StartRange = (string) content.GetValueForProperty("StartRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRangeInternal)this).StartRange, global::System.Convert.ToString); + } + if (content.Contains("EndRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRangeInternal)this).EndRange = (string) content.GetValueForProperty("EndRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRangeInternal)this).StartRange = (string) content.GetValueForProperty("StartRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRangeInternal)this).StartRange, global::System.Convert.ToString); + } + if (content.Contains("EndRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRangeInternal)this).EndRange = (string) content.GetValueForProperty("EndRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.TypeConverter.cs new file mode 100644 index 000000000000..07224cfa0445 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreRange ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.cs new file mode 100644 index 000000000000..fe19ad951b64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob range + public partial class BlobRestoreRange : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreRange.json.cs new file mode 100644 index 000000000000..964e5093c5d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.PowerShell.cs new file mode 100644 index 000000000000..c8b8273c8268 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreStatusInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("RestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).RestoreId = (string) content.GetValueForProperty("RestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).RestoreId, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("RestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).RestoreId = (string) content.GetValueForProperty("RestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).RestoreId, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.TypeConverter.cs new file mode 100644 index 000000000000..842a77d5a18b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobRestoreStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.cs new file mode 100644 index 000000000000..961376fe47c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore status. + public partial class BlobRestoreStatus : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal.FailureReason { get => this._failureReason; set { {_failureReason = value;} } } + + /// Internal Acessors for Parameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParameters()); set { {_parameter = value;} } } + + /// Internal Acessors for RestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParametersInternal)Parameter).BlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParametersInternal)Parameter).TimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreParameters Parameter { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobRestoreStatus.json.cs new file mode 100644 index 000000000000..591f85c26c8b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IBlobRestoreStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.PowerShell.cs new file mode 100644 index 000000000000..e8010c9b3d26 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.TypeConverter.cs new file mode 100644 index 000000000000..6e320f36f920 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServiceItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.cs new file mode 100644 index 000000000000..99de7590c271 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class BlobServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItemsInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties[] Value { get; } + + } + internal partial interface IBlobServiceItemsInternal + + { + /// List of blob services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceItems.json.cs new file mode 100644 index 000000000000..d8f7ed90f32e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..822bc6b72a00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("BlobServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).BlobServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGenerated) content.GetValueForProperty("BlobServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).BlobServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("BlobServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).BlobServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGenerated) content.GetValueForProperty("BlobServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).BlobServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..6a96df00f884 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.cs new file mode 100644 index 000000000000..85041fcd7bf4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGenerated BlobServiceProperty { get => (this._blobServiceProperty = this._blobServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGenerated) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGenerated BlobServiceProperty { get; set; } + /// Sku name and tier. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServiceProperties.json.cs new file mode 100644 index 000000000000..7000967cfcf8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.Sku.FromJson(__jsonSku) : Sku;} + {_blobServiceProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobServicePropertiesAutoGenerated.FromJson(__jsonProperties) : BlobServiceProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..ebf8fe0312b1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("DeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("DeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ChangeFeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeed) content.GetValueForProperty("ChangeFeed",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeedTypeConverter.ConvertFrom); + } + if (content.Contains("RestorePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyProperties) content.GetValueForProperty("RestorePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("ContainerDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicy) content.GetValueForProperty("LastAccessTimeTrackingPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LastAccessTimeTrackingPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultServiceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion = (string) content.GetValueForProperty("DefaultServiceVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion, global::System.Convert.ToString); + } + if (content.Contains("IsVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled = (bool?) content.GetValueForProperty("IsVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutomaticSnapshotPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled = (bool?) content.GetValueForProperty("AutomaticSnapshotPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay = (int?) content.GetValueForProperty("DeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastAccessTimeTrackingPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("LastAccessTimeTrackingPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicyBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType = (string[]) content.GetValueForProperty("LastAccessTimeTrackingPolicyBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("DeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("DeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled = (bool?) content.GetValueForProperty("ChangeFeedEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedRetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay = (int?) content.GetValueForProperty("ChangeFeedRetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled = (bool) content.GetValueForProperty("RestorePolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestorePolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay = (int?) content.GetValueForProperty("RestorePolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyMinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ContainerDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyEnable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable = (bool) content.GetValueForProperty("LastAccessTimeTrackingPolicyEnable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyTrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay = (int?) content.GetValueForProperty("LastAccessTimeTrackingPolicyTrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("DeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("DeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ChangeFeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeed) content.GetValueForProperty("ChangeFeed",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeedTypeConverter.ConvertFrom); + } + if (content.Contains("RestorePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyProperties) content.GetValueForProperty("RestorePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("ContainerDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicy) content.GetValueForProperty("LastAccessTimeTrackingPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LastAccessTimeTrackingPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultServiceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion = (string) content.GetValueForProperty("DefaultServiceVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion, global::System.Convert.ToString); + } + if (content.Contains("IsVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled = (bool?) content.GetValueForProperty("IsVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutomaticSnapshotPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled = (bool?) content.GetValueForProperty("AutomaticSnapshotPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay = (int?) content.GetValueForProperty("DeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastAccessTimeTrackingPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("LastAccessTimeTrackingPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicyBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType = (string[]) content.GetValueForProperty("LastAccessTimeTrackingPolicyBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("DeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("DeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled = (bool?) content.GetValueForProperty("ChangeFeedEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedRetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay = (int?) content.GetValueForProperty("ChangeFeedRetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled = (bool) content.GetValueForProperty("RestorePolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestorePolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay = (int?) content.GetValueForProperty("RestorePolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyMinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ContainerDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyEnable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable = (bool) content.GetValueForProperty("LastAccessTimeTrackingPolicyEnable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyTrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay = (int?) content.GetValueForProperty("LastAccessTimeTrackingPolicyTrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..353a3fa240d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..b7622e6f0d2a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IBlobServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IChangeFeed ChangeFeed { get => (this._changeFeed = this._changeFeed ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IChangeFeedInternal)ChangeFeed).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IChangeFeedInternal)ChangeFeed).RetentionInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeedInternal)ChangeFeed).RetentionInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicy ContainerDeleteRetentionPolicy { get => (this._containerDeleteRetentionPolicy = this._containerDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Enabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IDeleteRetentionPolicy DeleteRetentionPolicy { get => (this._deleteRetentionPolicy = this._deleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy { get => (this._lastAccessTimeTrackingPolicy = this._lastAccessTimeTrackingPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Enable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).TrackingGranularityInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).TrackingGranularityInDay = value ?? default(int); } + + /// Internal Acessors for ChangeFeed + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeed Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.ChangeFeed { get => (this._changeFeed = this._changeFeed ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeed()); set { {_changeFeed = value;} } } + + /// Internal Acessors for ContainerDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.ContainerDeleteRetentionPolicy { get => (this._containerDeleteRetentionPolicy = this._containerDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy()); set { {_containerDeleteRetentionPolicy = value;} } } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRules()); set { {_cor = value;} } } + + /// Internal Acessors for DeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.DeleteRetentionPolicy { get => (this._deleteRetentionPolicy = this._deleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy()); set { {_deleteRetentionPolicy = value;} } } + + /// Internal Acessors for LastAccessTimeTrackingPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.LastAccessTimeTrackingPolicy { get => (this._lastAccessTimeTrackingPolicy = this._lastAccessTimeTrackingPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LastAccessTimeTrackingPolicy()); set { {_lastAccessTimeTrackingPolicy = value;} } } + + /// Internal Acessors for RestorePolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicy { get => (this._restorePolicy = this._restorePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyProperties()); set { {_restorePolicy = value;} } } + + /// Internal Acessors for RestorePolicyLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicyLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).LastEnabledTime = value; } + + /// Internal Acessors for RestorePolicyMinRestoreTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicyMinRestoreTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).MinRestoreTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).MinRestoreTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyProperties RestorePolicy { get => (this._restorePolicy = this._restorePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)RestorePolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/BlobServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..10d9a5c1a963 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.CorsRules.FromJson(__jsonCors) : Cor;} + {_deleteRetentionPolicy = If( json?.PropertyT("deleteRetentionPolicy"), out var __jsonDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy.FromJson(__jsonDeleteRetentionPolicy) : DeleteRetentionPolicy;} + {_changeFeed = If( json?.PropertyT("changeFeed"), out var __jsonChangeFeed) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ChangeFeed.FromJson(__jsonChangeFeed) : ChangeFeed;} + {_restorePolicy = If( json?.PropertyT("restorePolicy"), out var __jsonRestorePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RestorePolicyProperties.FromJson(__jsonRestorePolicy) : RestorePolicy;} + {_containerDeleteRetentionPolicy = If( json?.PropertyT("containerDeleteRetentionPolicy"), out var __jsonContainerDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy.FromJson(__jsonContainerDeleteRetentionPolicy) : ContainerDeleteRetentionPolicy;} + {_lastAccessTimeTrackingPolicy = If( json?.PropertyT("lastAccessTimeTrackingPolicy"), out var __jsonLastAccessTimeTrackingPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.PowerShell.cs new file mode 100644 index 000000000000..98d65bbb52b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IChangeFeedInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeedInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeedInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IChangeFeedInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeedInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeedInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.TypeConverter.cs new file mode 100644 index 000000000000..080df06e5438 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IChangeFeed ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.cs new file mode 100644 index 000000000000..4157a60c1998 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IChangeFeed, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ChangeFeed.json.cs new file mode 100644 index 000000000000..1f57476be26b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IChangeFeed. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IChangeFeed. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.PowerShell.cs new file mode 100644 index 000000000000..acb400920816 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICheckNameAvailabilityResultInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICheckNameAvailabilityResultInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.TypeConverter.cs new file mode 100644 index 000000000000..9d209a2c0012 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICheckNameAvailabilityResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.cs new file mode 100644 index 000000000000..c786734adda8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The CheckNameAvailability operation response. + public partial class CheckNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICheckNameAvailabilityResultInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NameAvailable + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CheckNameAvailabilityResult.json.cs new file mode 100644 index 000000000000..ba43f0d93b64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICheckNameAvailabilityResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICheckNameAvailabilityResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudError.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudError.PowerShell.cs new file mode 100644 index 000000000000..2c0f197ffad5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudError.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudError.TypeConverter.cs new file mode 100644 index 000000000000..a9a82f16f6ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudError.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudError.cs new file mode 100644 index 000000000000..648e3f048702 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBody[] Detail { get; set; } + /// An error response from the Storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudError.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudError.json.cs new file mode 100644 index 000000000000..2317d92e29c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.CloudErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.PowerShell.cs new file mode 100644 index 000000000000..bd4095ba81cf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.TypeConverter.cs new file mode 100644 index 000000000000..af62601e793d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudErrorBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.cs new file mode 100644 index 000000000000..40d8e9e5b30d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CloudErrorBody.json.cs new file mode 100644 index 000000000000..7afd270e8fb4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICloudErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CloudErrorBody.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICloudErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.PowerShell.cs new file mode 100644 index 000000000000..a45a0f674a59 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.TypeConverter.cs new file mode 100644 index 000000000000..ce955490256f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IContainerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.cs new file mode 100644 index 000000000000..59ceae117588 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a container. + public partial class ContainerProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyProperties ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioning ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILegalHoldProperties LegalHold { get => (this._legalHold = this._legalHold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITagProperty[] LegalHoldTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).Tag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.Deleted { get => this._deleted; set { {_deleted = value;} } } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.DeletedTime { get => this._deletedTime; set { {_deletedTime = value;} } } + + /// Internal Acessors for HasImmutabilityPolicy + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.HasImmutabilityPolicy { get => this._hasImmutabilityPolicy; set { {_hasImmutabilityPolicy = value;} } } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.HasLegalHold { get => this._hasLegalHold; set { {_hasLegalHold = value;} } } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperties()); set { {_immutabilityPolicy = value;} } } + + /// Internal Acessors for ImmutabilityPolicyEtag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Etag = value; } + + /// Internal Acessors for ImmutabilityPolicyProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutabilityPolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Property = value; } + + /// Internal Acessors for ImmutabilityPolicyUpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioning()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningMigrationState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).MigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).MigrationState = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningTimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).TimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).TimeStamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IContainerPropertiesInternal.LeaseStatus { get => this._leaseStatus; set { {_leaseStatus = value;} } } + + /// Internal Acessors for LegalHold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.LegalHold { get => (this._legalHold = this._legalHold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldProperties()); set { {_legalHold = value;} } } + + /// Internal Acessors for LegalHoldHasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).HasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).HasLegalHold = value; } + + /// Internal Acessors for LegalHoldProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.LegalHoldProtectedAppendWritesHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWritesHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWritesHistory = value; } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryTimestamp = value; } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyProperty ImmutabilityPolicyProperty { get; set; } + /// The ImmutabilityPolicy update history of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IProtectedAppendWritesHistory LegalHoldProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerProperties.json.cs new file mode 100644 index 000000000000..b82e7fc7a465 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ImmutabilityPolicyProperties.FromJson(__jsonImmutabilityPolicy) : ImmutabilityPolicy;} + {_legalHold = If( json?.PropertyT("legalHold"), out var __jsonLegalHold) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldProperties.FromJson(__jsonLegalHold) : LegalHold;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IContainerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..25bb198d621c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..5a4ad3d5cb64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IContainerPropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.cs new file mode 100644 index 000000000000..d10fbaa286d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IContainerPropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..c320e14d9224 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ContainerPropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ContainerPropertiesMetadata.json.cs new file mode 100644 index 000000000000..086789c86344 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IContainerPropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRule.PowerShell.cs new file mode 100644 index 000000000000..c433f0c9f3f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRuleInternal)this).AllowedOrigin = (string[]) content.GetValueForProperty("AllowedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedMethod = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[]) content.GetValueForProperty("AllowedMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRuleInternal)this).MaxAgeInSecond = (int) content.GetValueForProperty("MaxAgeInSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).MaxAgeInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExposedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).ExposedHeader = (string[]) content.GetValueForProperty("ExposedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).ExposedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedHeader = (string[]) content.GetValueForProperty("AllowedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRuleInternal)this).AllowedOrigin = (string[]) content.GetValueForProperty("AllowedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedMethod = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[]) content.GetValueForProperty("AllowedMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRuleInternal)this).MaxAgeInSecond = (int) content.GetValueForProperty("MaxAgeInSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).MaxAgeInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExposedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).ExposedHeader = (string[]) content.GetValueForProperty("ExposedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).ExposedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRuleInternal)this).AllowedHeader = (string[]) content.GetValueForProperty("AllowedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRule.TypeConverter.cs new file mode 100644 index 000000000000..bfb343ccde25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRule.cs new file mode 100644 index 000000000000..6bbd99b136c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRule.json.cs new file mode 100644 index 000000000000..3ef2b333ee85 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRules.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRules.PowerShell.cs new file mode 100644 index 000000000000..6ffce4ff8fee --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRulesInternal)this).CorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)this).CorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRulesInternal)this).CorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)this).CorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRules.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRules.TypeConverter.cs new file mode 100644 index 000000000000..9296896e326a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRules ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CorsRules.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRules.cs new file mode 100644 index 000000000000..398ae5eb2eda --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRules, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRules.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CorsRules.json.cs new file mode 100644 index 000000000000..93f81afa45ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICorsRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRule.FromJson(__u) )) ))() : null : CorsRule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CustomDomain.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CustomDomain.PowerShell.cs new file mode 100644 index 000000000000..62eaf7ae351f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICustomDomainInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomainInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("UseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomainInternal)this).UseSubDomainName = (bool?) content.GetValueForProperty("UseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomainInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("UseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomainInternal)this).UseSubDomainName = (bool?) content.GetValueForProperty("UseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CustomDomain.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CustomDomain.TypeConverter.cs new file mode 100644 index 000000000000..5432f247e34e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICustomDomain ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CustomDomain.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CustomDomain.cs new file mode 100644 index 000000000000..58a1590cab1a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICustomDomain, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/CustomDomain.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/CustomDomain.json.cs new file mode 100644 index 000000000000..c618b6691d5c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ICustomDomain. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.PowerShell.cs new file mode 100644 index 000000000000..d5afb35ebbcb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.TypeConverter.cs new file mode 100644 index 000000000000..a08f5f2799b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterCreation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.cs new file mode 100644 index 000000000000..f17bb44045b8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterCreation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterCreation.json.cs new file mode 100644 index 000000000000..3b035e8ca9a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterCreation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.PowerShell.cs new file mode 100644 index 000000000000..90e65328390f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.TypeConverter.cs new file mode 100644 index 000000000000..bfa48d38466d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterModification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.cs new file mode 100644 index 000000000000..97515c22cd4e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterModification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DateAfterModification.json.cs new file mode 100644 index 000000000000..f9f5ed9c85e2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDateAfterModification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.PowerShell.cs new file mode 100644 index 000000000000..775808ae0992 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeleteRetentionPolicyInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete = (bool?) content.GetValueForProperty("AllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete = (bool?) content.GetValueForProperty("AllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.TypeConverter.cs new file mode 100644 index 000000000000..17087a1013db --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeleteRetentionPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.cs new file mode 100644 index 000000000000..06c7bcfe6c01 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeleteRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeleteRetentionPolicy.json.cs new file mode 100644 index 000000000000..c4daf0552ac8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeleteRetentionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.PowerShell.cs new file mode 100644 index 000000000000..3031b44f6e0e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.TypeConverter.cs new file mode 100644 index 000000000000..5e682bd7576f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.cs new file mode 100644 index 000000000000..f17f8944cb2f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Deleted storage account + public partial class DeletedAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IDeletedAccountInternal.CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for DeletionTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal.DeletionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).DeletionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).DeletionTime = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).Location = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountProperties()); set { {_property = value;} } } + + /// Internal Acessors for RestoreReference + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal.RestoreReference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).RestoreReference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).RestoreReference = value; } + + /// Internal Acessors for StorageAccountResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountInternal.StorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)Property).StorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IDeletedAccountProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccount.json.cs new file mode 100644 index 000000000000..30e6d22306ca --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.DeletedAccountProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.PowerShell.cs new file mode 100644 index 000000000000..bef3b568c163 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeletedAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.TypeConverter.cs new file mode 100644 index 000000000000..13f6dae32314 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.cs new file mode 100644 index 000000000000..9e849cedefa7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccount[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IDeletedAccount) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccount[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountListResult.json.cs new file mode 100644 index 000000000000..0c70206dbf6b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccount) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.PowerShell.cs new file mode 100644 index 000000000000..f6b9de21e73e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.TypeConverter.cs new file mode 100644 index 000000000000..f7338ece4b9b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.cs new file mode 100644 index 000000000000..d96b56a2a60d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedAccountPropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for DeletionTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal.DeletionTime { get => this._deletionTime; set { {_deletionTime = value;} } } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for RestoreReference + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountPropertiesInternal.RestoreReference { get => this._restoreReference; set { {_restoreReference = value;} } } + + /// Internal Acessors for StorageAccountResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedAccountProperties.json.cs new file mode 100644 index 000000000000..de513ddcbd00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedAccountProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedAccountProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedShare.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedShare.PowerShell.cs new file mode 100644 index 000000000000..843a5a1cdcfb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedShareInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedShareInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedShareInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeletedShareInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedShareInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedShareInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedShare.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedShare.TypeConverter.cs new file mode 100644 index 000000000000..f18cc6a59763 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedShare.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedShare.cs new file mode 100644 index 000000000000..fdf79506cd25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedShare, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/DeletedShare.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/DeletedShare.json.cs new file mode 100644 index 000000000000..523a07102481 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDeletedShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeletedShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Dimension.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Dimension.PowerShell.cs new file mode 100644 index 000000000000..81a8bcac578b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Dimension.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Dimension.TypeConverter.cs new file mode 100644 index 000000000000..1b262c547898 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDimension ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Dimension.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Dimension.cs new file mode 100644 index 000000000000..72e1e6ae4cab --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDimension, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Dimension.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Dimension.json.cs new file mode 100644 index 000000000000..678c17743abf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IDimension. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimension. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Encryption.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Encryption.PowerShell.cs new file mode 100644 index 000000000000..d5dfb89e19ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServices) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServicesTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("KeySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource?) content.GetValueForProperty("KeySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource.CreateFrom); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServiceBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceFile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceFile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceTable = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceTable, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceQueue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceQueue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity = (string) content.GetValueForProperty("IdentityEncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("IdentityEncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("IdentityEncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServices) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServicesTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("KeySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource?) content.GetValueForProperty("KeySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource.CreateFrom); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServiceBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceFile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceFile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceTable = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceTable, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceQueue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("ServiceQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).ServiceQueue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity = (string) content.GetValueForProperty("IdentityEncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("IdentityEncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("IdentityEncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Encryption.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Encryption.TypeConverter.cs new file mode 100644 index 000000000000..ef77e9cb3c6a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryption ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Encryption.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Encryption.cs new file mode 100644 index 000000000000..33aa4b0f02d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryption, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).BlobEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).BlobKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).FileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).FileKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).FileLastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionIdentityInternal)Identity).EncryptionFederatedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionIdentityInternal)Identity).EncryptionUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; } + + /// Internal Acessors for BlobLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).BlobLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).BlobLastEnabledTime = value; } + + /// Internal Acessors for FileLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).FileLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).FileLastEnabledTime = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for KeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultProperties()); set { {_keyVaultProperty = value;} } } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyExpirationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyExpirationTimestamp = value; } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp = value; } + + /// Internal Acessors for QueueLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).QueueLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).QueueLastEnabledTime = value; } + + /// Internal Acessors for Service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServices Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.Service { get => (this._service = this._service ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServices()); set { {_service = value;} } } + + /// Internal Acessors for ServiceBlob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.ServiceBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Blob = value; } + + /// Internal Acessors for ServiceFile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.ServiceFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).File = value; } + + /// Internal Acessors for ServiceQueue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.ServiceQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Queue = value; } + + /// Internal Acessors for ServiceTable + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.ServiceTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).Table = value; } + + /// Internal Acessors for TableLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionInternal.TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)Service).TableLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).QueueEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).QueueKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionServices Service { get => (this._service = this._service ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).TableEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)Service).TableKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionServices Service { get; set; } + /// The encryption function of the blob storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService ServiceBlob { get; set; } + /// The encryption function of the file storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService ServiceFile { get; set; } + /// The encryption function of the queue storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService ServiceQueue { get; set; } + /// The encryption function of the table storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Encryption.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Encryption.json.cs new file mode 100644 index 000000000000..0fa6ca6c4d5d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.EncryptionServices.FromJson(__jsonServices) : Service;} + {_keyVaultProperty = If( json?.PropertyT("keyvaultproperties"), out var __jsonKeyvaultproperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyVaultProperties.FromJson(__jsonKeyvaultproperties) : KeyVaultProperty;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryption. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.PowerShell.cs new file mode 100644 index 000000000000..917fe2df0733 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity = (string) content.GetValueForProperty("EncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("EncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("EncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity = (string) content.GetValueForProperty("EncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("EncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("EncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.TypeConverter.cs new file mode 100644 index 000000000000..9a12d65d49bd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.cs new file mode 100644 index 000000000000..b659d3fbadff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionIdentity.json.cs new file mode 100644 index 000000000000..37ca471d59d5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.PowerShell.cs new file mode 100644 index 000000000000..bec85c0f38d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyCreationTime = (global::System.DateTime?) content.GetValueForProperty("PropertyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("PropertyKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PropertySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("PropertySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("PropertyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("PropertyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption = (bool?) content.GetValueForProperty("PropertyRequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyCreationTime = (global::System.DateTime?) content.GetValueForProperty("PropertyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("PropertyKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PropertySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("PropertySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("PropertyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("PropertyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption = (bool?) content.GetValueForProperty("PropertyRequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.TypeConverter.cs new file mode 100644 index 000000000000..1a42be5fa846 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScope ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.cs new file mode 100644 index 000000000000..b5214b670640 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Encryption Scope resource. + public partial class EncryptionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyCurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyCurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyLastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyLastKeyRotationTimestamp = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyCreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal.PropertyCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for PropertyKeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal.PropertyKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).KeyVaultProperty = value; } + + /// Internal Acessors for PropertyLastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeInternal.PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)Property).RequireInfrastructureEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScope.json.cs new file mode 100644 index 000000000000..2c3fb10f213f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.EncryptionScopeProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.PowerShell.cs new file mode 100644 index 000000000000..dba9437d5518 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri = (string) content.GetValueForProperty("KeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri = (string) content.GetValueForProperty("KeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.TypeConverter.cs new file mode 100644 index 000000000000..e4b74d08c83c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeKeyVaultProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.cs new file mode 100644 index 000000000000..dd82a3ebfd37 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal.CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; set { {_currentVersionedKeyIdentifier = value;} } } + + /// Internal Acessors for LastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeKeyVaultProperties.json.cs new file mode 100644 index 000000000000..71504cceb28a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeKeyVaultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.PowerShell.cs new file mode 100644 index 000000000000..f575c9c9b0fd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.TypeConverter.cs new file mode 100644 index 000000000000..e7ddf4bac556 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.cs new file mode 100644 index 000000000000..5217ee94e8b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScope[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScope[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeListResult.json.cs new file mode 100644 index 000000000000..5f60543de1ae --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScope) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopeListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.PowerShell.cs new file mode 100644 index 000000000000..3390e32c8095 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.TypeConverter.cs new file mode 100644 index 000000000000..695b636733c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionScopeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.cs new file mode 100644 index 000000000000..0a36b81e1086 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the encryption scope. + public partial class EncryptionScopeProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).KeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScopePropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for KeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionScopeKeyVaultProperties()); set { {_keyVaultProperty = value;} } } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopePropertiesInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionScopeProperties.json.cs new file mode 100644 index 000000000000..0cd638557dde --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.IEncryptionScopeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionScopeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionService.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionService.PowerShell.cs new file mode 100644 index 000000000000..a90c9c271647 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionServiceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)this).KeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)this).KeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionService.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionService.TypeConverter.cs new file mode 100644 index 000000000000..5833a6079667 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionService ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionService.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionService.cs new file mode 100644 index 000000000000..c8adf20cbcf5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionService, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionService.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionService.json.cs new file mode 100644 index 000000000000..ae82aba25de7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionService. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.PowerShell.cs new file mode 100644 index 000000000000..a6bb07972c7d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Blob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).File = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).File, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Table, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Queue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Queue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Blob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).File = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).File, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Table, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Queue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).Queue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServicesInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.TypeConverter.cs new file mode 100644 index 000000000000..75851dc9e904 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.cs new file mode 100644 index 000000000000..35bb735dce7d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEncryptionServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionService Blob { get => (this._blob = this._blob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Blob).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Blob).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Blob).LastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionService File { get => (this._file = this._file ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)File).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)File).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)File).LastEnabledTime; } + + /// Internal Acessors for Blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.Blob { get => (this._blob = this._blob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService()); set { {_blob = value;} } } + + /// Internal Acessors for BlobLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Blob).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Blob).LastEnabledTime = value; } + + /// Internal Acessors for File + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.File { get => (this._file = this._file ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService()); set { {_file = value;} } } + + /// Internal Acessors for FileLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)File).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)File).LastEnabledTime = value; } + + /// Internal Acessors for Queue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.Queue { get => (this._queue = this._queue ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService()); set { {_queue = value;} } } + + /// Internal Acessors for QueueLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Queue).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Queue).LastEnabledTime = value; } + + /// Internal Acessors for Table + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.Table { get => (this._table = this._table ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService()); set { {_table = value;} } } + + /// Internal Acessors for TableLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServicesInternal.TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Table).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServiceInternal)Table).LastEnabledTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionService Queue { get => (this._queue = this._queue ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Queue).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Queue).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Queue).LastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionService Table { get => (this._table = this._table ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Table).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryptionServiceInternal)Table).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/EncryptionServices.json.cs new file mode 100644 index 000000000000..9b7cae523382 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.EncryptionService.FromJson(__jsonBlob) : Blob;} + {_file = If( json?.PropertyT("file"), out var __jsonFile) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService.FromJson(__jsonFile) : File;} + {_table = If( json?.PropertyT("table"), out var __jsonTable) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService.FromJson(__jsonTable) : Table;} + {_queue = If( json?.PropertyT("queue"), out var __jsonQueue) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionService.FromJson(__jsonQueue) : Queue;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryptionServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Endpoints.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Endpoints.PowerShell.cs new file mode 100644 index 000000000000..fd027f416bef --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IEndpointsInternal)this).MicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("MicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("InternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("InternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Df, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointBlob = (string) content.GetValueForProperty("MicrosoftEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointQueue = (string) content.GetValueForProperty("MicrosoftEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointTable = (string) content.GetValueForProperty("MicrosoftEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointFile = (string) content.GetValueForProperty("MicrosoftEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointWeb = (string) content.GetValueForProperty("MicrosoftEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointDf = (string) content.GetValueForProperty("MicrosoftEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointBlob = (string) content.GetValueForProperty("InternetEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointFile = (string) content.GetValueForProperty("InternetEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointWeb = (string) content.GetValueForProperty("InternetEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointDf = (string) content.GetValueForProperty("InternetEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEndpointsInternal)this).MicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("MicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("InternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("InternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).Df, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointBlob = (string) content.GetValueForProperty("MicrosoftEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointQueue = (string) content.GetValueForProperty("MicrosoftEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointTable = (string) content.GetValueForProperty("MicrosoftEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointFile = (string) content.GetValueForProperty("MicrosoftEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointWeb = (string) content.GetValueForProperty("MicrosoftEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointDf = (string) content.GetValueForProperty("MicrosoftEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).MicrosoftEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointBlob = (string) content.GetValueForProperty("InternetEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointFile = (string) content.GetValueForProperty("InternetEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointWeb = (string) content.GetValueForProperty("InternetEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)this).InternetEndpointDf = (string) content.GetValueForProperty("InternetEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Endpoints.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Endpoints.TypeConverter.cs new file mode 100644 index 000000000000..ec45bf6cd90b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Endpoints.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Endpoints.cs new file mode 100644 index 000000000000..647ca339a429 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternetEndpoints InternetEndpoint { get => (this._internetEndpoint = this._internetEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web; } + + /// Internal Acessors for Blob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for InternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.InternetEndpoint { get => (this._internetEndpoint = this._internetEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpoints()); set { {_internetEndpoint = value;} } } + + /// Internal Acessors for InternetEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.InternetEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Blob = value; } + + /// Internal Acessors for InternetEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.InternetEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Df = value; } + + /// Internal Acessors for InternetEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.InternetEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).File = value; } + + /// Internal Acessors for InternetEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.InternetEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web = value; } + + /// Internal Acessors for MicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpoint { get => (this._microsoftEndpoint = this._microsoftEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpoints()); set { {_microsoftEndpoint = value;} } } + + /// Internal Acessors for MicrosoftEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Blob = value; } + + /// Internal Acessors for MicrosoftEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Df = value; } + + /// Internal Acessors for MicrosoftEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).File = value; } + + /// Internal Acessors for MicrosoftEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Queue = value; } + + /// Internal Acessors for MicrosoftEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Table = value; } + + /// Internal Acessors for MicrosoftEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.MicrosoftEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Web = value; } + + /// Internal Acessors for Queue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.Queue { get => this._queue; set { {_queue = value;} } } + + /// Internal Acessors for Table + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal.Web { get => this._web; set { {_web = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountMicrosoftEndpoints MicrosoftEndpoint { get => (this._microsoftEndpoint = this._microsoftEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Endpoints.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Endpoints.json.cs new file mode 100644 index 000000000000..af327394c25e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.StorageAccountMicrosoftEndpoints.FromJson(__jsonMicrosoftEndpoints) : MicrosoftEndpoint;} + {_internetEndpoint = If( json?.PropertyT("internetEndpoints"), out var __jsonInternetEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..fb50ac700e51 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ErrorResponseBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ErrorResponseBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..81f56a2cd83e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.cs new file mode 100644 index 000000000000..6d02c09737ef --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)Error).Code = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponse.json.cs new file mode 100644 index 000000000000..af6e7b2ceed0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ErrorResponseBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.PowerShell.cs new file mode 100644 index 000000000000..8b280d68255a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.TypeConverter.cs new file mode 100644 index 000000000000..48d4e4fa22fa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IErrorResponseBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.cs new file mode 100644 index 000000000000..7929141e65a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Error response body contract. + public partial class ErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ErrorResponseBody.json.cs new file mode 100644 index 000000000000..d695c4566fd7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IErrorResponseBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IErrorResponseBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.PowerShell.cs new file mode 100644 index 000000000000..455780445139 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + /// + [System.ComponentModel.TypeConverter(typeof(ExecutionTargetTypeConverter))] + public partial class ExecutionTarget + { + + /// + /// 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.Api20230501.IExecutionTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExecutionTarget(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.Api20230501.IExecutionTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExecutionTarget(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExecutionTarget(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).Prefix = (string[]) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).Prefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).ExcludePrefix, __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 ExecutionTarget(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).Prefix = (string[]) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).Prefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)this).ExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, 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.Api20230501.IExecutionTarget 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(); + } + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + [System.ComponentModel.TypeConverter(typeof(ExecutionTargetTypeConverter))] + public partial interface IExecutionTarget + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.TypeConverter.cs new file mode 100644 index 000000000000..437806f26d9b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExecutionTargetTypeConverter : 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.Api20230501.IExecutionTarget ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExecutionTarget.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExecutionTarget.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExecutionTarget.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.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.cs new file mode 100644 index 000000000000..b3a15bc05864 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + /// + public partial class ExecutionTarget : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal + { + + /// Backing field for property. + private string[] _excludePrefix; + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [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 string[] _prefix; + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] Prefix { get => this._prefix; set => this._prefix = value; } + + /// Creates an new instance. + public ExecutionTarget() + { + + } + } + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + public partial interface IExecutionTarget : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] Prefix { get; set; } + + } + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + internal partial interface IExecutionTargetInternal + + { + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] ExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] Prefix { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.json.cs new file mode 100644 index 000000000000..48b4fff72898 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTarget.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + /// storage task + /// + public partial class ExecutionTarget + { + + /// + /// 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 ExecutionTarget(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefix = If( json?.PropertyT("prefix"), out var __jsonPrefix) ? If( __jsonPrefix 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 : Prefix;} + {_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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ExecutionTarget(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._prefix) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._prefix ) + { + 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("prefix",__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); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.PowerShell.cs new file mode 100644 index 000000000000..623ac7e72071 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Execution trigger for storage task assignment + [System.ComponentModel.TypeConverter(typeof(ExecutionTriggerTypeConverter))] + public partial class ExecutionTrigger + { + + /// + /// 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.Api20230501.IExecutionTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExecutionTrigger(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.Api20230501.IExecutionTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExecutionTrigger(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExecutionTrigger(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.Api20230501.IExecutionTriggerInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartOn, (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 ExecutionTrigger(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.Api20230501.IExecutionTriggerInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)this).ParameterStartOn, (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.Api20230501.IExecutionTrigger 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(); + } + /// Execution trigger for storage task assignment + [System.ComponentModel.TypeConverter(typeof(ExecutionTriggerTypeConverter))] + public partial interface IExecutionTrigger + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.TypeConverter.cs new file mode 100644 index 000000000000..ce70bb2405d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExecutionTriggerTypeConverter : 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.Api20230501.IExecutionTrigger ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExecutionTrigger.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExecutionTrigger.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExecutionTrigger.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.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.cs new file mode 100644 index 000000000000..39ea014595dc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution trigger for storage task assignment + public partial class ExecutionTrigger : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal + { + + /// Internal Acessors for Parameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParameters()); set { {_parameter = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters _parameter; + + /// The trigger parameters of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParameters()); set => this._parameter = value; } + + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).EndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).EndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).Interval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).Interval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).IntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).IntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).StartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).StartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).StartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)Parameter).StartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType _type; + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExecutionTrigger() + { + + } + } + /// Execution trigger for storage task assignment + public partial interface IExecutionTrigger : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType Type { get; set; } + + } + /// Execution trigger for storage task assignment + internal partial interface IExecutionTriggerInternal + + { + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Parameter { get; set; } + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.json.cs new file mode 100644 index 000000000000..6360d4e8002e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTrigger.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution trigger for storage task assignment + public partial class ExecutionTrigger + { + + /// + /// 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 ExecutionTrigger(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.Api20230501.TriggerParameters.FromJson(__jsonParameters) : Parameter;} + {_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.Api20230501.IExecutionTrigger. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ExecutionTrigger(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._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,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.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.PowerShell.cs new file mode 100644 index 000000000000..7a0f32173ada --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Execution trigger update for storage task assignment + [System.ComponentModel.TypeConverter(typeof(ExecutionTriggerUpdateTypeConverter))] + public partial class ExecutionTriggerUpdate + { + + /// + /// 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.Api20230501.IExecutionTriggerUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExecutionTriggerUpdate(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.Api20230501.IExecutionTriggerUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExecutionTriggerUpdate(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExecutionTriggerUpdate(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.Api20230501.IExecutionTriggerUpdateInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartOn, (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 ExecutionTriggerUpdate(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.Api20230501.IExecutionTriggerUpdateInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)this).ParameterStartOn, (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.Api20230501.IExecutionTriggerUpdate 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(); + } + /// Execution trigger update for storage task assignment + [System.ComponentModel.TypeConverter(typeof(ExecutionTriggerUpdateTypeConverter))] + public partial interface IExecutionTriggerUpdate + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.TypeConverter.cs new file mode 100644 index 000000000000..39e1a28c18e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExecutionTriggerUpdateTypeConverter : 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.Api20230501.IExecutionTriggerUpdate ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExecutionTriggerUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExecutionTriggerUpdate.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExecutionTriggerUpdate.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.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.cs new file mode 100644 index 000000000000..2229c8f128eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution trigger update for storage task assignment + public partial class ExecutionTriggerUpdate : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal + { + + /// Internal Acessors for Parameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdate()); set { {_parameter = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate _parameter; + + /// The trigger parameters of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdate()); set => this._parameter = value; } + + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).EndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).EndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).Interval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).Interval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).IntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).IntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).StartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).StartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).StartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)Parameter).StartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? _type; + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExecutionTriggerUpdate() + { + + } + } + /// Execution trigger update for storage task assignment + public partial interface IExecutionTriggerUpdate : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? Type { get; set; } + + } + /// Execution trigger update for storage task assignment + internal partial interface IExecutionTriggerUpdateInternal + + { + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Parameter { get; set; } + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.json.cs new file mode 100644 index 000000000000..9b762693d4ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExecutionTriggerUpdate.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution trigger update for storage task assignment + public partial class ExecutionTriggerUpdate + { + + /// + /// 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 ExecutionTriggerUpdate(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.Api20230501.TriggerParametersUpdate.FromJson(__jsonParameters) : Parameter;} + {_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.Api20230501.IExecutionTriggerUpdate. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ExecutionTriggerUpdate(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._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,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.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.PowerShell.cs new file mode 100644 index 000000000000..22e8a7118363 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.TypeConverter.cs new file mode 100644 index 000000000000..3235d5d2e0da --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IExtendedLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.cs new file mode 100644 index 000000000000..e8d38f66e405 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IExtendedLocation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ExtendedLocation.json.cs new file mode 100644 index 000000000000..d343a8444f0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IExtendedLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.PowerShell.cs new file mode 100644 index 000000000000..384316712b9a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.TypeConverter.cs new file mode 100644 index 000000000000..e0ebdde19723 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServiceItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.cs new file mode 100644 index 000000000000..4cf02b46c7ad --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class FileServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItemsInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties[] Value { get; } + + } + internal partial interface IFileServiceItemsInternal + + { + /// List of file services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceItems.json.cs new file mode 100644 index 000000000000..952270ab8d37 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..44a5b4954b3b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileServicePropertiesInternal)this).FileServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGenerated) content.GetValueForProperty("FileServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings) content.GetValueForProperty("FileServicePropertyProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("FileServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("FileServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("FileServicePropertyShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("FileServicePropertyShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesInternal)this).FileServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGenerated) content.GetValueForProperty("FileServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings) content.GetValueForProperty("FileServicePropertyProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("FileServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("FileServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("FileServicePropertyShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("FileServicePropertyShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..f9dd2753f40e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.cs new file mode 100644 index 000000000000..7e2cbbfb0501 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).CorCorsRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGenerated FileServiceProperty { get => (this._fileServiceProperty = this._fileServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.FileServiceProperty { get => (this._fileServiceProperty = this._fileServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileServicePropertiesAutoGenerated()); set { {_fileServiceProperty = value;} } } + + /// Internal Acessors for FileServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.FileServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).Cor = value; } + + /// Internal Acessors for FileServicePropertyProtocolSetting + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.FileServicePropertyProtocolSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSetting = value; } + + /// Internal Acessors for FileServicePropertyShareDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.FileServicePropertyShareDeleteRetentionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicy = value; } + + /// Internal Acessors for ProtocolSettingSmb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.ProtocolSettingSmb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSettingSmb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSettingSmb = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier = value; } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbMultichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyAllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbKerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of File services in storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules FileServicePropertyCor { get; set; } + /// Protocol settings for file service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings FileServicePropertyProtocolSetting { get; set; } + /// The file service properties for share soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy FileServicePropertyShareDeleteRetentionPolicy { get; set; } + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// Setting for SMB protocol + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServiceProperties.json.cs new file mode 100644 index 000000000000..a23114b007e2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.FileServicePropertiesAutoGenerated.FromJson(__jsonProperties) : FileServiceProperty;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku.FromJson(__jsonSku) : Sku;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..9fb832ac5519 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("ShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings) content.GetValueForProperty("ProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy) content.GetValueForProperty("ShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings) content.GetValueForProperty("ProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..d713d90802a7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..20ac0021ca5c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRules()); set { {_cor = value;} } } + + /// Internal Acessors for ProtocolSetting + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal.ProtocolSetting { get => (this._protocolSetting = this._protocolSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettings()); set { {_protocolSetting = value;} } } + + /// Internal Acessors for ProtocolSettingSmb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal.ProtocolSettingSmb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)ProtocolSetting).Smb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)ProtocolSetting).Smb = value; } + + /// Internal Acessors for ShareDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal.ShareDeleteRetentionPolicy { get => (this._shareDeleteRetentionPolicy = this._shareDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy()); set { {_shareDeleteRetentionPolicy = value;} } } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGeneratedInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)ProtocolSetting).SmbMultichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)ProtocolSetting).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)ProtocolSetting).MultichannelEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettings ProtocolSetting { get => (this._protocolSetting = this._protocolSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettings()); set => this._protocolSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicy ShareDeleteRetentionPolicy { get => (this._shareDeleteRetentionPolicy = this._shareDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)ProtocolSetting).SmbAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)ProtocolSetting).SmbChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)ProtocolSetting).SmbKerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)ProtocolSetting).SmbVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// Protocol settings for file service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings ProtocolSetting { get; set; } + /// Setting for SMB protocol + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting ProtocolSettingSmb { get; set; } + /// The file service properties for share soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..8fd05841e5e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.CorsRules.FromJson(__jsonCors) : Cor;} + {_shareDeleteRetentionPolicy = If( json?.PropertyT("shareDeleteRetentionPolicy"), out var __jsonShareDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DeleteRetentionPolicy.FromJson(__jsonShareDeleteRetentionPolicy) : ShareDeleteRetentionPolicy;} + {_protocolSetting = If( json?.PropertyT("protocolSettings"), out var __jsonProtocolSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtocolSettings.FromJson(__jsonProtocolSettings) : ProtocolSetting;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShare.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShare.PowerShell.cs new file mode 100644 index 000000000000..c59729ee03a8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("PropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("PropertyShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareQuota = (int?) content.GetValueForProperty("PropertyShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyEnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyEnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("PropertyEnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyEnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("PropertyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyVersion = (string) content.GetValueForProperty("PropertyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyVersion, global::System.Convert.ToString); + } + if (content.Contains("PropertyDeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeletedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyDeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyLeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("PropertyLeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("PropertyLeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("PropertyLeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("PropertyLeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("PropertyLeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertySnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySnapshotTime = (global::System.DateTime?) content.GetValueForProperty("PropertySnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyRootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("PropertyRootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("PropertyDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeleted = (bool?) content.GetValueForProperty("PropertyDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertyRemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRemainingRetentionDay = (int?) content.GetValueForProperty("PropertyRemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyAccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("PropertyAccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("PropertyAccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("PropertyAccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyAccessTierStatus = (string) content.GetValueForProperty("PropertyAccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("PropertyShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareUsageByte = (long?) content.GetValueForProperty("PropertyShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("PropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("PropertyShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareQuota = (int?) content.GetValueForProperty("PropertyShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyEnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyEnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("PropertyEnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyEnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("PropertyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyVersion = (string) content.GetValueForProperty("PropertyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyVersion, global::System.Convert.ToString); + } + if (content.Contains("PropertyDeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeletedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyDeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyLeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("PropertyLeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("PropertyLeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("PropertyLeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("PropertyLeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("PropertyLeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyLeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertySnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertySnapshotTime = (global::System.DateTime?) content.GetValueForProperty("PropertySnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyRootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("PropertyRootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("PropertyDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeleted = (bool?) content.GetValueForProperty("PropertyDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertyRemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRemainingRetentionDay = (int?) content.GetValueForProperty("PropertyRemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyRemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyAccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("PropertyAccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("PropertyAccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("PropertyAccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareInternal)this).PropertyAccessTierStatus = (string) content.GetValueForProperty("PropertyAccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyAccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("PropertyShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal)this).PropertyShareUsageByte = (long?) content.GetValueForProperty("PropertyShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShare.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShare.TypeConverter.cs new file mode 100644 index 000000000000..d38b98810958 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShare.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShare.cs new file mode 100644 index 000000000000..d000744e02cf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShare, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyAccessTierChangeTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyAccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierChangeTime = value; } + + /// Internal Acessors for PropertyAccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyAccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierStatus = value; } + + /// Internal Acessors for PropertyDeleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for PropertyDeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyDeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for PropertyLastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for PropertyLeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyLeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for PropertyLeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyLeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for PropertyLeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyLeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for PropertyRemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyRemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for PropertyShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).ShareUsageByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).ShareUsageByte = value; } + + /// Internal Acessors for PropertySnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertySnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SnapshotTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SnapshotTime = value; } + + /// Internal Acessors for PropertyVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareInternal.PropertyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).EnabledProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata PropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).ShareQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISignedIdentifier[] PropertySignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShare.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShare.json.cs new file mode 100644 index 000000000000..06c4c440ed43 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.FileShareProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItem.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItem.PowerShell.cs new file mode 100644 index 000000000000..82e697489395 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileShareItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItem.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItem.TypeConverter.cs new file mode 100644 index 000000000000..3d1f47bb0c80 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItem.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItem.cs new file mode 100644 index 000000000000..643795546cb6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareItem, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).EnabledProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata Metadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemInternal.AccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierChangeTime = value; } + + /// Internal Acessors for AccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.AccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).AccessTierStatus = value; } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for ShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.ShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).ShareUsageByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).ShareUsageByte = value; } + + /// Internal Acessors for SnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.SnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SnapshotTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SnapshotTime = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)Property).ShareQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISignedIdentifier[] SignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesMetadata Metadata { get; set; } + /// The file share properties be listed out. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItem.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItem.json.cs new file mode 100644 index 000000000000..cd651428222c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.FileShareProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItems.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItems.PowerShell.cs new file mode 100644 index 000000000000..1579a419423b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileShareItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileShareItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItems.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItems.TypeConverter.cs new file mode 100644 index 000000000000..35c60c0570b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareItems.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItems.cs new file mode 100644 index 000000000000..3d51b8016a5e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItemsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItem[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileShareItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItem[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItems.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareItems.json.cs new file mode 100644 index 000000000000..9e3e14e3be83 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareItem) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.PowerShell.cs new file mode 100644 index 000000000000..efca18220ec5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileSharePropertiesInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.TypeConverter.cs new file mode 100644 index 000000000000..b5ae6b236084 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.cs new file mode 100644 index 000000000000..7affd74d28e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileShareProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.FileSharePropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for AccessTierChangeTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.AccessTierChangeTime { get => this._accessTierChangeTime; set { {_accessTierChangeTime = value;} } } + + /// Internal Acessors for AccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.AccessTierStatus { get => this._accessTierStatus; set { {_accessTierStatus = value;} } } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.Deleted { get => this._deleted; set { {_deleted = value;} } } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.DeletedTime { get => this._deletedTime; set { {_deletedTime = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesInternal.LeaseStatus { get => this._leaseStatus; set { {_leaseStatus = value;} } } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.RemainingRetentionDay { get => this._remainingRetentionDay; set { {_remainingRetentionDay = value;} } } + + /// Internal Acessors for ShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.ShareUsageByte { get => this._shareUsageByte; set { {_shareUsageByte = value;} } } + + /// Internal Acessors for SnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesInternal.SnapshotTime { get => this._snapshotTime; set { {_snapshotTime = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileShareProperties.json.cs new file mode 100644 index 000000000000..c5870d806b23 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.ISignedIdentifier) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IFileShareProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileShareProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..870cd533d5b8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..52ff6efebab8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileSharePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.cs new file mode 100644 index 000000000000..1e1ae85c67c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileSharePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..9a0652b4a9d7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.FileSharePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/FileSharePropertiesMetadata.json.cs new file mode 100644 index 000000000000..626757eaba7d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IFileSharePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IFileSharePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.PowerShell.cs new file mode 100644 index 000000000000..5d19d7b24c5e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IGeoReplicationStatsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("LastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).LastSyncTime = (global::System.DateTime?) content.GetValueForProperty("LastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IGeoReplicationStatsInternal)this).CanFailover = (bool?) content.GetValueForProperty("CanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanPlannedFailover = (bool?) content.GetValueForProperty("CanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("PostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("PostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("PostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.CreateFrom); + } + 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.Api20230501.IGeoReplicationStatsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("LastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).LastSyncTime = (global::System.DateTime?) content.GetValueForProperty("LastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IGeoReplicationStatsInternal)this).CanFailover = (bool?) content.GetValueForProperty("CanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanPlannedFailover = (bool?) content.GetValueForProperty("CanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).CanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("PostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("PostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("PostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)this).PostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.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(); + } + /// 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.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.TypeConverter.cs new file mode 100644 index 000000000000..baebe032a4f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IGeoReplicationStats ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.cs new file mode 100644 index 000000000000..0aea88621370 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.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.Api20230501 +{ + 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.Api20230501.IGeoReplicationStats, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 bool? _canPlannedFailover; + + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? CanPlannedFailover { get => this._canPlannedFailover; } + + /// 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.Api20230501.IGeoReplicationStatsInternal.CanFailover { get => this._canFailover; set { {_canFailover = value;} } } + + /// Internal Acessors for CanPlannedFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal.CanPlannedFailover { get => this._canPlannedFailover; set { {_canPlannedFailover = value;} } } + + /// Internal Acessors for LastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal.LastSyncTime { get => this._lastSyncTime; set { {_lastSyncTime = value;} } } + + /// Internal Acessors for PostFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal.PostFailoverRedundancy { get => this._postFailoverRedundancy; set { {_postFailoverRedundancy = value;} } } + + /// Internal Acessors for PostPlannedFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal.PostPlannedFailoverRedundancy { get => this._postPlannedFailoverRedundancy; set { {_postPlannedFailoverRedundancy = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? _postFailoverRedundancy; + + /// The redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? PostFailoverRedundancy { get => this._postFailoverRedundancy; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? _postPlannedFailoverRedundancy; + + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? PostPlannedFailoverRedundancy { get => this._postPlannedFailoverRedundancy; } + + /// 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; } + /// + /// A boolean flag which indicates whether or not planned 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 planned account failover is supported for the account.", + SerializedName = @"canPlannedFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? CanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after an account failover is performed.", + SerializedName = @"postFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? PostFailoverRedundancy { get; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after a planned account failover is performed.", + SerializedName = @"postPlannedFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? PostPlannedFailoverRedundancy { 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; } + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + bool? CanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? PostFailoverRedundancy { get; set; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? PostPlannedFailoverRedundancy { 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.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.json.cs new file mode 100644 index 000000000000..ef7e0688db66 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/GeoReplicationStats.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.Api20230501 +{ + 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.Api20230501.IGeoReplicationStats. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_canPlannedFailover = If( json?.PropertyT("canPlannedFailover"), out var __jsonCanPlannedFailover) ? (bool?)__jsonCanPlannedFailover : CanPlannedFailover;} + {_postFailoverRedundancy = If( json?.PropertyT("postFailoverRedundancy"), out var __jsonPostFailoverRedundancy) ? (string)__jsonPostFailoverRedundancy : (string)PostFailoverRedundancy;} + {_postPlannedFailoverRedundancy = If( json?.PropertyT("postPlannedFailoverRedundancy"), out var __jsonPostPlannedFailoverRedundancy) ? (string)__jsonPostPlannedFailoverRedundancy : (string)PostPlannedFailoverRedundancy;} + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._canPlannedFailover ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._canPlannedFailover) : null, "canPlannedFailover" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._postFailoverRedundancy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._postFailoverRedundancy.ToString()) : null, "postFailoverRedundancy" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._postPlannedFailoverRedundancy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._postPlannedFailoverRedundancy.ToString()) : null, "postPlannedFailoverRedundancy" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IPRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IPRule.PowerShell.cs new file mode 100644 index 000000000000..b725bacbd2de --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRuleInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRuleInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRuleInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRuleInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IPRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IPRule.TypeConverter.cs new file mode 100644 index 000000000000..4edf82b1410f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIPRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IPRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IPRule.cs new file mode 100644 index 000000000000..db1be6221178 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIPRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IPRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IPRule.json.cs new file mode 100644 index 000000000000..0c6eb51ebc99 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIPRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Identity.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Identity.PowerShell.cs new file mode 100644 index 000000000000..d23b9f4a8837 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Identity.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Identity.TypeConverter.cs new file mode 100644 index 000000000000..ca39652bd3c2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Identity.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Identity.cs new file mode 100644 index 000000000000..a36dda36a2c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Identity for the resource. + public partial class Identity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Identity.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Identity.json.cs new file mode 100644 index 000000000000..17d661a36d23 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..49fc5ae71bb8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..4c326c2dac1a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.cs new file mode 100644 index 000000000000..eca0f9d4bb42 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..218ac33cade7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/IdentityUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..2c201acc68fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IIdentityUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.PowerShell.cs new file mode 100644 index 000000000000..5c7a81290143 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.TypeConverter.cs new file mode 100644 index 000000000000..dbe530292678 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.cs new file mode 100644 index 000000000000..4407fd53a62d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperty()); set { {_property = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicy.json.cs new file mode 100644 index 000000000000..b085d13f3bf2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..a6685bd2af0a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("UpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("UpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("UpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("UpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..8e1d2bc6aeac --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.cs new file mode 100644 index 000000000000..516d3d15619c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyProperty()); set { {_property = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)Property).State = value; } + + /// Internal Acessors for UpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertiesInternal.UpdateHistory { get => this._updateHistory; set { {_updateHistory = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)Property).State; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty[] UpdateHistory { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperties.json.cs new file mode 100644 index 000000000000..b59254376b21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.PowerShell.cs new file mode 100644 index 000000000000..432898360c5f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.TypeConverter.cs new file mode 100644 index 000000000000..7043efea9beb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.cs new file mode 100644 index 000000000000..53daccd3ee34 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutabilityPolicyProperty.json.cs new file mode 100644 index 000000000000..4f4973f899ef --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutabilityPolicyProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.PowerShell.cs new file mode 100644 index 000000000000..2fa802c53dd4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.TypeConverter.cs new file mode 100644 index 000000000000..8c6efcff1885 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.cs new file mode 100644 index 000000000000..5e5611d7e4a9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IAccountImmutabilityPolicyProperties ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal.ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageAccount.json.cs new file mode 100644 index 000000000000..e978a79ccca5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.PowerShell.cs new file mode 100644 index 000000000000..60a2dcca40f6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioningInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.TypeConverter.cs new file mode 100644 index 000000000000..566a0a143cb8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageWithVersioning ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.cs new file mode 100644 index 000000000000..cf30c728652b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageWithVersioning, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageWithVersioningInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for TimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ImmutableStorageWithVersioning.json.cs new file mode 100644 index 000000000000..2ad9bab970bc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IImmutableStorageWithVersioning. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.PowerShell.cs new file mode 100644 index 000000000000..a0f06020242d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IKeyCreationTimeInternal)this).Key1 = (global::System.DateTime?) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTimeInternal)this).Key2 = (global::System.DateTime?) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTimeInternal)this).Key1 = (global::System.DateTime?) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTimeInternal)this).Key2 = (global::System.DateTime?) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.TypeConverter.cs new file mode 100644 index 000000000000..827212d692a5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyCreationTime ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.cs new file mode 100644 index 000000000000..432b744efaff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage account keys creation time. + public partial class KeyCreationTime : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyCreationTime.json.cs new file mode 100644 index 000000000000..7067a5d0624f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyCreationTime. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.PowerShell.cs new file mode 100644 index 000000000000..d0126d3c79d7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.TypeConverter.cs new file mode 100644 index 000000000000..f3fcc4fc35e1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.cs new file mode 100644 index 000000000000..08c7d1f264f9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyPolicy.json.cs new file mode 100644 index 000000000000..68885eb2d03b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.PowerShell.cs new file mode 100644 index 000000000000..ff666935eaf0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVaultUri = (string) content.GetValueForProperty("KeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("CurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVaultUri = (string) content.GetValueForProperty("KeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).KeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("CurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.TypeConverter.cs new file mode 100644 index 000000000000..0df8abeaecf4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyVaultProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.cs new file mode 100644 index 000000000000..27588d713bc9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of key vault. + public partial class KeyVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyVaultPropertiesInternal.CurrentVersionedKeyExpirationTimestamp { get => this._currentVersionedKeyExpirationTimestamp; set { {_currentVersionedKeyExpirationTimestamp = value;} } } + + /// Internal Acessors for CurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultPropertiesInternal.CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; set { {_currentVersionedKeyIdentifier = value;} } } + + /// Internal Acessors for LastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/KeyVaultProperties.json.cs new file mode 100644 index 000000000000..89abdf2c74d7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IKeyVaultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyVaultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.PowerShell.cs new file mode 100644 index 000000000000..d7c0d299d056 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Enable = (bool) content.GetValueForProperty("Enable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Enable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("TrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay = (int?) content.GetValueForProperty("TrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Enable = (bool) content.GetValueForProperty("Enable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Enable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("TrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay = (int?) content.GetValueForProperty("TrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicyInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.TypeConverter.cs new file mode 100644 index 000000000000..e9664aee49dc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILastAccessTimeTrackingPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.cs new file mode 100644 index 000000000000..a2fa05cfd5ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILastAccessTimeTrackingPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LastAccessTimeTrackingPolicy.json.cs new file mode 100644 index 000000000000..0b213373033e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILastAccessTimeTrackingPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILastAccessTimeTrackingPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.PowerShell.cs new file mode 100644 index 000000000000..c0b9eca2b37c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Lease Container request schema. + [System.ComponentModel.TypeConverter(typeof(LeaseContainerRequestTypeConverter))] + public partial class LeaseContainerRequest + { + + /// + /// 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.Api20230501.ILeaseContainerRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LeaseContainerRequest(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.Api20230501.ILeaseContainerRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LeaseContainerRequest(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.Api20230501.ILeaseContainerRequest 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 LeaseContainerRequest(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.Api20230501.ILeaseContainerRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)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 LeaseContainerRequest(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.Api20230501.ILeaseContainerRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal)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(LeaseContainerRequestTypeConverter))] + public partial interface ILeaseContainerRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.TypeConverter.cs new file mode 100644 index 000000000000..bafed8a1ecc7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + 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) => 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.Api20230501.ILeaseContainerRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LeaseContainerRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LeaseContainerRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LeaseContainerRequest.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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.cs new file mode 100644 index 000000000000..075d3f113cdf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container request schema. + public partial class LeaseContainerRequest : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction _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.LeaseContainerRequestAction 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 LeaseContainerRequest() + { + + } + } + /// Lease Container request schema. + public partial interface ILeaseContainerRequest : + 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.LeaseContainerRequestAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction 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 ILeaseContainerRequestInternal + + { + /// Specifies the lease action. Can be one of the available actions. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction 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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.json.cs new file mode 100644 index 000000000000..788b932f811b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerRequest.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container request schema. + public partial class LeaseContainerRequest + { + + /// + /// 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.Api20230501.ILeaseContainerRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LeaseContainerRequest(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 LeaseContainerRequest(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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.PowerShell.cs new file mode 100644 index 000000000000..6c6aa5e35152 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILeaseContainerResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILeaseContainerResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.TypeConverter.cs new file mode 100644 index 000000000000..dd66e441aacc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseContainerResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.cs new file mode 100644 index 000000000000..e42da60cc0ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container response schema. + public partial class LeaseContainerResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseContainerResponse.json.cs new file mode 100644 index 000000000000..ab9666adc4b8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseContainerResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.PowerShell.cs new file mode 100644 index 000000000000..fd4dc8aca69d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILeaseShareRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.TypeConverter.cs new file mode 100644 index 000000000000..2933511b6a31 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseShareRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.cs new file mode 100644 index 000000000000..112796276836 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share request schema. + public partial class LeaseShareRequest : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequest, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareRequest.json.cs new file mode 100644 index 000000000000..17e9702f9368 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseShareRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.PowerShell.cs new file mode 100644 index 000000000000..9283d24f831c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILeaseShareResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponseInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.TypeConverter.cs new file mode 100644 index 000000000000..6f9d9174edce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseShareResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.cs new file mode 100644 index 000000000000..062eb207041b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share response schema. + public partial class LeaseShareResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LeaseShareResponse.json.cs new file mode 100644 index 000000000000..946e1f7a43ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILeaseShareResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseShareResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHold.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHold.PowerShell.cs new file mode 100644 index 000000000000..3ab0e6ea68af --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILegalHoldInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHold.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHold.TypeConverter.cs new file mode 100644 index 000000000000..9214aa44d4f0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHold ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHold.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHold.cs new file mode 100644 index 000000000000..75cfb7e0faea --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHold, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHold.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHold.json.cs new file mode 100644 index 000000000000..22f3add8deb1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHold. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHold. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.PowerShell.cs new file mode 100644 index 000000000000..7d4c165c6449 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("ProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("ProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.TypeConverter.cs new file mode 100644 index 000000000000..0fad8ef15227 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHoldProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.cs new file mode 100644 index 000000000000..ad42d90bea9d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHoldProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILegalHoldPropertiesInternal.HasLegalHold { get => this._hasLegalHold; set { {_hasLegalHold = value;} } } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp = value; } + + /// Internal Acessors for ProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldPropertiesInternal.ProtectedAppendWritesHistory { get => (this._protectedAppendWritesHistory = this._protectedAppendWritesHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtectedAppendWritesHistory ProtectedAppendWritesHistory { get => (this._protectedAppendWritesHistory = this._protectedAppendWritesHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistory()); set => this._protectedAppendWritesHistory = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtectedAppendWritesHistory ProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LegalHoldProperties.json.cs new file mode 100644 index 000000000000..6009d4df03ca --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILegalHoldProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITagProperty) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.PowerShell.cs new file mode 100644 index 000000000000..6a1d687da4ef --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListAccountSasResponseInternal)this).AccountSasToken = (string) content.GetValueForProperty("AccountSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListAccountSasResponseInternal)this).AccountSasToken = (string) content.GetValueForProperty("AccountSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.TypeConverter.cs new file mode 100644 index 000000000000..ca9e43cdb013 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListAccountSasResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.cs new file mode 100644 index 000000000000..557a7a22abb2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListAccountSasResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListAccountSasResponse.json.cs new file mode 100644 index 000000000000..8d48e4eed28b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListAccountSasResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListAccountSasResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.PowerShell.cs new file mode 100644 index 000000000000..47fdf03d9464 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListBlobInventoryPolicyInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListBlobInventoryPolicyInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListBlobInventoryPolicyInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListBlobInventoryPolicyInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.TypeConverter.cs new file mode 100644 index 000000000000..bffd8d5a6c0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListBlobInventoryPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.cs new file mode 100644 index 000000000000..44df23884579 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListBlobInventoryPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListBlobInventoryPolicyInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListBlobInventoryPolicyInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy[] Value { get; } + + } + /// List of blob inventory policies returned. + internal partial interface IListBlobInventoryPolicyInternal + + { + /// List of blob inventory policies. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobInventoryPolicy[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListBlobInventoryPolicy.json.cs new file mode 100644 index 000000000000..79f3c5b2b1ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListBlobInventoryPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListBlobInventoryPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobInventoryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.PowerShell.cs new file mode 100644 index 000000000000..7a042fc0cbca --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListContainerItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.TypeConverter.cs new file mode 100644 index 000000000000..081a28918b0b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.cs new file mode 100644 index 000000000000..ed5868144873 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItem, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).DefaultEncryptionScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).DenyEncryptionScopeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).EnableNfsV3AllSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).EnableNfsV3RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITagProperty[] LegalHoldTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHoldTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesMetadata Metadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemInternal.Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for HasImmutabilityPolicy + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.HasImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).HasImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).HasImmutabilityPolicy = value; } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.HasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).HasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).HasLegalHold = value; } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicy = value; } + + /// Internal Acessors for ImmutabilityPolicyEtag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyEtag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyEtag = value; } + + /// Internal Acessors for ImmutabilityPolicyProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutabilityPolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyProperty = value; } + + /// Internal Acessors for ImmutabilityPolicyUpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyUpdateHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutabilityPolicyUpdateHistory = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageWithVersioning Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningMigrationState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningMigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningMigrationState = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningTimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningTimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningTimeStamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for LegalHold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILegalHoldProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHold = value; } + + /// Internal Acessors for LegalHoldHasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHoldHasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHoldHasLegalHold = value; } + + /// Internal Acessors for LegalHoldProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.LegalHoldProtectedAppendWritesHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHoldProtectedAppendWritesHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).LegalHoldProtectedAppendWritesHistory = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ContainerProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryTimestamp = value; } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).State = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IContainerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IContainerPropertiesInternal)Property).PublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerPropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IImmutabilityPolicyProperty ImmutabilityPolicyProperty { get; set; } + /// The ImmutabilityPolicy update history of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IProtectedAppendWritesHistory LegalHoldProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerPropertiesMetadata Metadata { get; set; } + /// The blob container properties be listed out. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItem.json.cs new file mode 100644 index 000000000000..244dee437cd9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.PowerShell.cs new file mode 100644 index 000000000000..3bf92bfb58a0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListContainerItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListContainerItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.TypeConverter.cs new file mode 100644 index 000000000000..ef237511597a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.cs new file mode 100644 index 000000000000..d5355942313f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItemsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItem[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListContainerItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItem[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListContainerItems.json.cs new file mode 100644 index 000000000000..1822fd2a7180 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListContainerItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListContainerItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListContainerItem) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueue.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueue.PowerShell.cs new file mode 100644 index 000000000000..49f3b2df24ad --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueue.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueue.TypeConverter.cs new file mode 100644 index 000000000000..492fda9d76b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueue.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueue.cs new file mode 100644 index 000000000000..4dca15ac6573 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueue, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueInternal.QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IListQueueProperties QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueuePropertiesMetadata QueuePropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesInternal)QueueProperty).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueProperties QueueProperty { get; set; } + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueue.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueue.json.cs new file mode 100644 index 000000000000..bee9b5c1ef12 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.PowerShell.cs new file mode 100644 index 000000000000..9b043c71df69 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.TypeConverter.cs new file mode 100644 index 000000000000..cd214f4237cc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.cs new file mode 100644 index 000000000000..339a56df477e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueuePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata Metadata { get; set; } + + } + internal partial interface IListQueuePropertiesInternal + + { + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata Metadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueProperties.json.cs new file mode 100644 index 000000000000..bb5edc18d83d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..9631d52109f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..44ac42ad5d79 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueuePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.cs new file mode 100644 index 000000000000..4987b4f4d263 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueuePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..61af93f99a10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ListQueuePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueuePropertiesMetadata.json.cs new file mode 100644 index 000000000000..5851b611c836 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueuePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueuePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.PowerShell.cs new file mode 100644 index 000000000000..1a549561b183 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListQueueResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueueTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ListQueueTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.TypeConverter.cs new file mode 100644 index 000000000000..ee288cd76e9a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.cs new file mode 100644 index 000000000000..cfa383aff4e8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResourceInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueue[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListQueue) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueue[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueResource.json.cs new file mode 100644 index 000000000000..356e072eecc8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueue) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.PowerShell.cs new file mode 100644 index 000000000000..70b681158dc7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListQueueServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListQueueServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.TypeConverter.cs new file mode 100644 index 000000000000..53e99933f676 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.cs new file mode 100644 index 000000000000..875567eb38ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServicesInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServicesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueueServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties[] Value { get; } + + } + internal partial interface IListQueueServicesInternal + + { + /// List of queue services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListQueueServices.json.cs new file mode 100644 index 000000000000..9325285235e7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListQueueServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListQueueServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.PowerShell.cs new file mode 100644 index 000000000000..5844e14b7a73 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListServiceSasResponseInternal)this).ServiceSasToken = (string) content.GetValueForProperty("ServiceSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListServiceSasResponseInternal)this).ServiceSasToken = (string) content.GetValueForProperty("ServiceSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.TypeConverter.cs new file mode 100644 index 000000000000..86dc0ca4cfcc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListServiceSasResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.cs new file mode 100644 index 000000000000..d422c47128c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListServiceSasResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListServiceSasResponseInternal + { + + /// Internal Acessors for ServiceSasToken + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListServiceSasResponse.json.cs new file mode 100644 index 000000000000..cd64532c699b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListServiceSasResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListServiceSasResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableResource.PowerShell.cs new file mode 100644 index 000000000000..d8f976bafe19 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListTableResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITable[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListTableResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITable[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableResource.TypeConverter.cs new file mode 100644 index 000000000000..9df3869c4ad4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListTableResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableResource.cs new file mode 100644 index 000000000000..50ee1d73a30f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListTableResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResourceInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITable[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITable) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITable[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableResource.json.cs new file mode 100644 index 000000000000..fd67f709f6ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListTableResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITable) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableServices.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableServices.PowerShell.cs new file mode 100644 index 000000000000..b44ec02d6ffa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IListTableServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IListTableServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableServices.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableServices.TypeConverter.cs new file mode 100644 index 000000000000..527d72c27e81 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListTableServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ListTableServices.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableServices.cs new file mode 100644 index 000000000000..200d0f2d4dce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListTableServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServicesInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServicesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITableServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties[] Value { get; } + + } + internal partial interface IListTableServicesInternal + + { + /// List of table services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableServices.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ListTableServices.json.cs new file mode 100644 index 000000000000..e6201982e9fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IListTableServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IListTableServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUser.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.PowerShell.cs new file mode 100644 index 000000000000..2221880fd476 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).UserId = (int?) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).UserId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).GroupId = (int?) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).GroupId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowAclAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).AllowAclAuthorization = (bool?) content.GetValueForProperty("AllowAclAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).AllowAclAuthorization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).ExtendedGroup = (int[]) content.GetValueForProperty("ExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).ExtendedGroup, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsNfSv3Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).IsNfSv3Enabled = (bool?) content.GetValueForProperty("IsNfSv3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).IsNfSv3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).UserId = (int?) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).UserId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).GroupId = (int?) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).GroupId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowAclAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).AllowAclAuthorization = (bool?) content.GetValueForProperty("AllowAclAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).AllowAclAuthorization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).ExtendedGroup = (int[]) content.GetValueForProperty("ExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).ExtendedGroup, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsNfSv3Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).IsNfSv3Enabled = (bool?) content.GetValueForProperty("IsNfSv3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).IsNfSv3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUser.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.TypeConverter.cs new file mode 100644 index 000000000000..a7a17324beb6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUser ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUser.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.cs new file mode 100644 index 000000000000..84477420b262 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.cs @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.ILocalUser, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowAclAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).AllowAclAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).AllowAclAuthorization = value ?? default(bool); } + + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int[] ExtendedGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).ExtendedGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).ExtendedGroup = value ?? null /* arrayOf */; } + + /// An identifier for associating a group of users. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).GroupId = value ?? default(int); } + + /// + /// 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.Api20230501.ILocalUserPropertiesInternal)Property).HasSharedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserPropertiesInternal)Property).HasSshKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserPropertiesInternal)Property).HasSshPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserPropertiesInternal)Property).HomeDirectory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + + /// Indicates if the local user is enabled for access with NFSv3 protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsNfSv3Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).IsNfSv3Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).IsNfSv3Enabled = value ?? default(bool); } + + /// 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.Api20230501.ILocalUserProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sid + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal.Sid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).Sid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).Sid = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for UserId + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserInternal.UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).UserId = 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.Api20230501.IPermissionScope[] PermissionScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).PermissionScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).PermissionScope = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISshPublicKey[] SshAuthorizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).SshAuthorizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + + /// A unique Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)Property).UserId; } + + /// 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 ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.", + SerializedName = @"allowAclAuthorization", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowAclAuthorization { get; set; } + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Supplementary group membership. Only applicable for local users enabled for NFSv3 access.", + SerializedName = @"extendedGroups", + PossibleTypes = new [] { typeof(int) })] + int[] ExtendedGroup { get; set; } + /// An identifier for associating a group of users. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for associating a group of users.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(int) })] + int? GroupId { get; set; } + /// + /// 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; } + /// Indicates if the local user is enabled for access with NFSv3 protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if the local user is enabled for access with NFSv3 protocol.", + SerializedName = @"isNFSv3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsNfSv3Enabled { 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.Api20230501.IPermissionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// A unique Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique Identifier that is generated by the server.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(int) })] + int? UserId { get; } + + } + /// The local user associated with the storage accounts. + internal partial interface ILocalUserInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + bool? AllowAclAuthorization { get; set; } + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + int[] ExtendedGroup { get; set; } + /// An identifier for associating a group of users. + int? GroupId { get; set; } + /// + /// 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; } + /// Indicates if the local user is enabled for access with NFSv3 protocol. + bool? IsNfSv3Enabled { get; set; } + /// The permission scopes of the local user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope[] PermissionScope { get; set; } + /// Storage account local user properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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; } + /// A unique Identifier that is generated by the server. + int? UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUser.json.cs new file mode 100644 index 000000000000..23b123dad220 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUser. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.PowerShell.cs new file mode 100644 index 000000000000..39eb3f950cf3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserKeysInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeysInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("SharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeysInternal)this).SharedKey = (string) content.GetValueForProperty("SharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserKeysInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeysInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("SharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeysInternal)this).SharedKey = (string) content.GetValueForProperty("SharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.TypeConverter.cs new file mode 100644 index 000000000000..0367e9d48575 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.cs new file mode 100644 index 000000000000..eb101242bd91 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserKeys, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeysInternal + { + + /// Internal Acessors for SharedKey + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey[] SshAuthorizedKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserKeys.json.cs new file mode 100644 index 000000000000..66c530b2bba4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.PowerShell.cs new file mode 100644 index 000000000000..832392e7dddd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserPropertiesInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).UserId = (int?) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).UserId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).GroupId = (int?) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).GroupId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowAclAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).AllowAclAuthorization = (bool?) content.GetValueForProperty("AllowAclAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).AllowAclAuthorization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).ExtendedGroup = (int[]) content.GetValueForProperty("ExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).ExtendedGroup, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsNfSv3Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).IsNfSv3Enabled = (bool?) content.GetValueForProperty("IsNfSv3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).IsNfSv3Enabled, (__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.Api20230501.ILocalUserPropertiesInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).UserId = (int?) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).UserId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).GroupId = (int?) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).GroupId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowAclAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).AllowAclAuthorization = (bool?) content.GetValueForProperty("AllowAclAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).AllowAclAuthorization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).ExtendedGroup = (int[]) content.GetValueForProperty("ExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).ExtendedGroup, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsNfSv3Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).IsNfSv3Enabled = (bool?) content.GetValueForProperty("IsNfSv3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal)this).IsNfSv3Enabled, (__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.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.TypeConverter.cs new file mode 100644 index 000000000000..91f223205da9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.cs new file mode 100644 index 000000000000..1e5a93d49767 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.ILocalUserProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal + { + + /// Backing field for property. + private bool? _allowAclAuthorization; + + /// + /// Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowAclAuthorization { get => this._allowAclAuthorization; set => this._allowAclAuthorization = value; } + + /// Backing field for property. + private int[] _extendedGroup; + + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int[] ExtendedGroup { get => this._extendedGroup; set => this._extendedGroup = value; } + + /// Backing field for property. + private int? _groupId; + + /// An identifier for associating a group of users. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? GroupId { get => this._groupId; set => this._groupId = value; } + + /// 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; } + + /// Backing field for property. + private bool? _isNfSv3Enabled; + + /// Indicates if the local user is enabled for access with NFSv3 protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsNfSv3Enabled { get => this._isNfSv3Enabled; set => this._isNfSv3Enabled = value; } + + /// Internal Acessors for Sid + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal.Sid { get => this._sid; set { {_sid = value;} } } + + /// Internal Acessors for UserId + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserPropertiesInternal.UserId { get => this._userId; set { {_userId = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISshPublicKey[] SshAuthorizedKey { get => this._sshAuthorizedKey; set => this._sshAuthorizedKey = value; } + + /// Backing field for property. + private int? _userId; + + /// A unique Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? UserId { get => this._userId; } + + /// 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 ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.", + SerializedName = @"allowAclAuthorization", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowAclAuthorization { get; set; } + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Supplementary group membership. Only applicable for local users enabled for NFSv3 access.", + SerializedName = @"extendedGroups", + PossibleTypes = new [] { typeof(int) })] + int[] ExtendedGroup { get; set; } + /// An identifier for associating a group of users. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for associating a group of users.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(int) })] + int? GroupId { get; set; } + /// + /// 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; } + /// Indicates if the local user is enabled for access with NFSv3 protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if the local user is enabled for access with NFSv3 protocol.", + SerializedName = @"isNFSv3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsNfSv3Enabled { 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.Api20230501.IPermissionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey[] SshAuthorizedKey { get; set; } + /// A unique Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique Identifier that is generated by the server.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(int) })] + int? UserId { get; } + + } + /// The Storage Account Local User properties. + internal partial interface ILocalUserPropertiesInternal + + { + /// + /// Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + bool? AllowAclAuthorization { get; set; } + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + int[] ExtendedGroup { get; set; } + /// An identifier for associating a group of users. + int? GroupId { get; set; } + /// + /// 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; } + /// Indicates if the local user is enabled for access with NFSv3 protocol. + bool? IsNfSv3Enabled { get; set; } + /// The permission scopes of the local user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey[] SshAuthorizedKey { get; set; } + /// A unique Identifier that is generated by the server. + int? UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.json.cs new file mode 100644 index 000000000000..81df1742d7e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserProperties.json.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.Api20230501 +{ + 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.Api20230501.ILocalUserProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (int?)__jsonUserId : UserId;} + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (int?)__jsonGroupId : GroupId;} + {_allowAclAuthorization = If( json?.PropertyT("allowAclAuthorization"), out var __jsonAllowAclAuthorization) ? (bool?)__jsonAllowAclAuthorization : AllowAclAuthorization;} + {_extendedGroup = If( json?.PropertyT("extendedGroups"), out var __jsonExtendedGroups) ? If( __jsonExtendedGroups 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)=>(int) (__k is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber __j ? (int)__j : default(int))) ))() : null : ExtendedGroup;} + {_isNfSv3Enabled = If( json?.PropertyT("isNFSv3Enabled"), out var __jsonIsNfSv3Enabled) ? (bool?)__jsonIsNfSv3Enabled : IsNfSv3Enabled;} + 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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._userId ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._userId) : null, "userId" ,container.Add ); + } + AddIf( null != this._groupId ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._groupId) : null, "groupId" ,container.Add ); + AddIf( null != this._allowAclAuthorization ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowAclAuthorization) : null, "allowAclAuthorization" ,container.Add ); + if (null != this._extendedGroup) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._extendedGroup ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber(__n) ,__m.Add); + } + container.Add("extendedGroups",__m); + } + AddIf( null != this._isNfSv3Enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isNfSv3Enabled) : null, "isNFSv3Enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.PowerShell.cs new file mode 100644 index 000000000000..66341693ca59 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword = (string) content.GetValueForProperty("SshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword = (string) content.GetValueForProperty("SshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.TypeConverter.cs new file mode 100644 index 000000000000..4e0cdf6898a1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserRegeneratePasswordResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.cs new file mode 100644 index 000000000000..566199e49e83 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserRegeneratePasswordResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserRegeneratePasswordResultInternal + { + + /// Internal Acessors for SshPassword + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUserRegeneratePasswordResult.json.cs new file mode 100644 index 000000000000..d051854f046d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUserRegeneratePasswordResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUserRegeneratePasswordResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUsers.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.PowerShell.cs new file mode 100644 index 000000000000..99463179bfe2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// List of local users requested, and if paging is required, a URL to the next page of 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ILocalUsersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)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 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.Api20230501.ILocalUsersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUserTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal)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(); + } + /// List of local users requested, and if paging is required, a URL to the next page of local users. + [System.ComponentModel.TypeConverter(typeof(LocalUsersTypeConverter))] + public partial interface ILocalUsers + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.TypeConverter.cs new file mode 100644 index 000000000000..8025a85c06b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ILocalUsers ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/LocalUsers.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.cs new file mode 100644 index 000000000000..af7ad8da69c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of local users requested, and if paging is required, a URL to the next page of local users. + /// + public partial class LocalUsers : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsers, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsersInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of local users. Returned when total number of requested local users 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.Api20230501.ILocalUser[] _value; + + /// The list of 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.Api20230501.ILocalUser[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public LocalUsers() + { + + } + } + /// List of local users requested, and if paging is required, a URL to the next page of local users. + public partial interface ILocalUsers : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of local users. Returned when total number of requested local users 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 local users. Returned when total number of requested local users exceeds the maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of local users associated with the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of local users associated with the storage account.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser[] Value { get; set; } + + } + /// List of local users requested, and if paging is required, a URL to the next page of local users. + internal partial interface ILocalUsersInternal + + { + /// + /// Request URL that can be used to query next page of local users. Returned when total number of requested local users exceeds + /// the maximum page size. + /// + string NextLink { get; set; } + /// The list of local users associated with the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUser[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.json.cs new file mode 100644 index 000000000000..feaa885ddbfe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/LocalUsers.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of local users requested, and if paging is required, a URL to the next page of 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.Api20230501.ILocalUsers. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILocalUsers. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ILocalUser) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LocalUser.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 (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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.PowerShell.cs new file mode 100644 index 000000000000..9622f0941138 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.TypeConverter.cs new file mode 100644 index 000000000000..6e24f489bb6f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.cs new file mode 100644 index 000000000000..abd34ee43858 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).Policy = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).PolicyRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)Property).PolicyRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyRule[] PolicyRule { get; set; } + /// Returns the Storage Account Data Policies Rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicy.json.cs new file mode 100644 index 000000000000..bd752f61964d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.PowerShell.cs new file mode 100644 index 000000000000..eb6af8478977 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.PowerShell.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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("Snapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Snapshot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot) content.GetValueForProperty("Snapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Snapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySnapShotTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersion) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyVersionTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).BaseBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob) content.GetValueForProperty("BaseBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).BaseBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlobTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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("Snapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Snapshot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot) content.GetValueForProperty("Snapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Snapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySnapShotTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersion) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyVersionTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).BaseBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob) content.GetValueForProperty("BaseBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).BaseBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlobTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("SnapshotDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionTierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("VersionDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotTierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionTierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.TypeConverter.cs new file mode 100644 index 000000000000..cb91f0a37398 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyAction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.cs new file mode 100644 index 000000000000..ae7123f5b202 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.cs @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IManagementPolicyAction, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob _baseBlob; + + /// The management policy action for base blob + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob BaseBlob { get => (this._baseBlob = this._baseBlob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlob()); set => this._baseBlob = value; } + + /// Internal Acessors for Snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.Snapshot { get => (this._snapshot = this._snapshot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySnapShot()); set { {_snapshot = value;} } } + + /// Internal Acessors for SnapshotDelete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.SnapshotDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).Delete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).Delete = value; } + + /// Internal Acessors for SnapshotTierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.SnapshotTierToArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToArchive = value; } + + /// Internal Acessors for SnapshotTierToCold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.SnapshotTierToCold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCold = value; } + + /// Internal Acessors for SnapshotTierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.SnapshotTierToCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCool = value; } + + /// Internal Acessors for SnapshotTierToHot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.SnapshotTierToHot { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHot = value; } + + /// Internal Acessors for Version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersion Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.Version { get => (this._version = this._version ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyVersion()); set { {_version = value;} } } + + /// Internal Acessors for VersionDelete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.VersionDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).Delete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).Delete = value; } + + /// Internal Acessors for VersionTierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.VersionTierToArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToArchive = value; } + + /// Internal Acessors for VersionTierToCold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.VersionTierToCold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToCold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToCold = value; } + + /// Internal Acessors for VersionTierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.VersionTierToCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToCool = value; } + + /// Internal Acessors for VersionTierToHot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyActionInternal.VersionTierToHot { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHot = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShot Snapshot { get => (this._snapshot = this._snapshot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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? SnapshotTierToColdDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToColdDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToColdDaysAfterCreationGreaterThan = 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? SnapshotTierToColdDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToColdDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToColdDaysAfterLastTierChangeGreaterThan = 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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterLastTierChangeGreaterThan = 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? SnapshotTierToHotDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHotDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHotDaysAfterCreationGreaterThan = 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? SnapshotTierToHotDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHotDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)Snapshot).TierToHotDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersion Version { get => (this._version = this._version ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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? VersionTierToColdDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToColdDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToColdDaysAfterCreationGreaterThan = 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? VersionTierToColdDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToColdDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToColdDaysAfterLastTierChangeGreaterThan = 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.Api20230501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterLastTierChangeGreaterThan = 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? VersionTierToHotDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHotDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHotDaysAfterCreationGreaterThan = 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? VersionTierToHotDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHotDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)Version).TierToHotDaysAfterLastTierChangeGreaterThan = 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 + { + /// The management policy action for base blob + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The management policy action for base blob", + SerializedName = @"baseBlob", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob BaseBlob { 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? SnapshotTierToColdDaysAfterCreationGreaterThan { 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? SnapshotTierToColdDaysAfterLastTierChangeGreaterThan { 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 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? SnapshotTierToHotDaysAfterCreationGreaterThan { 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? SnapshotTierToHotDaysAfterLastTierChangeGreaterThan { 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? VersionTierToColdDaysAfterCreationGreaterThan { 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? VersionTierToColdDaysAfterLastTierChangeGreaterThan { 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; } + /// 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? VersionTierToHotDaysAfterCreationGreaterThan { 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? VersionTierToHotDaysAfterLastTierChangeGreaterThan { 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.Api20230501.IManagementPolicyBaseBlob BaseBlob { get; set; } + /// The management policy action for snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot Snapshot { get; set; } + /// The function to delete the blob snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 blobs to cold storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation SnapshotTierToCold { get; set; } + /// Value indicating the age in days after creation + float? SnapshotTierToColdDaysAfterCreationGreaterThan { 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? SnapshotTierToColdDaysAfterLastTierChangeGreaterThan { get; set; } + /// The function to tier blob snapshot to cool storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation SnapshotTierToHot { get; set; } + /// Value indicating the age in days after creation + float? SnapshotTierToHotDaysAfterCreationGreaterThan { 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? SnapshotTierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + /// The management policy action for version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersion Version { get; set; } + /// The function to delete the blob version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 blobs to cold storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation VersionTierToCold { get; set; } + /// Value indicating the age in days after creation + float? VersionTierToColdDaysAfterCreationGreaterThan { 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? VersionTierToColdDaysAfterLastTierChangeGreaterThan { get; set; } + /// The function to tier blob version to cool storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation VersionTierToHot { get; set; } + /// Value indicating the age in days after creation + float? VersionTierToHotDaysAfterCreationGreaterThan { 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? VersionTierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyAction.json.cs new file mode 100644 index 000000000000..7f89e6352b21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyAction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; + } + {_snapshot = If( json?.PropertyT("snapshot"), out var __jsonSnapshot) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySnapShot.FromJson(__jsonSnapshot) : Snapshot;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyVersion.FromJson(__jsonVersion) : Version;} + {_baseBlob = If( json?.PropertyT("baseBlob"), out var __jsonBaseBlob) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyBaseBlob.FromJson(__jsonBaseBlob) : BaseBlob;} + 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._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 ); + AddIf( null != this._baseBlob ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._baseBlob.ToJson(null,serializationMode) : null, "baseBlob" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.PowerShell.cs new file mode 100644 index 000000000000..dc048a742bd0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.PowerShell.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("EnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("EnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("EnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("EnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.TypeConverter.cs new file mode 100644 index 000000000000..38680987b024 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyBaseBlob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.cs new file mode 100644 index 000000000000..ec9c0ea967f7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.cs @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IManagementPolicyBaseBlob, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModification Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)Delete).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)Delete).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal.TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set { {_tierToCold = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set { {_tierToCool = value;} } } + + /// Internal Acessors for TierToHot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlobInternal.TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set { {_tierToHot = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification _tierToArchive; + + /// The function to tier blobs to archive storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToArchive).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToArchive).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification _tierToCold; + + /// The function to tier blobs to cold storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set => this._tierToCold = 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? TierToColdDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).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? TierToColdDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).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? TierToColdDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).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? TierToColdDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCold).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification _tierToCool; + + /// The function to tier blobs to cool storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToCool).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterModificationInternal)TierToCool).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToCool).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification _tierToHot; + + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification()); set => this._tierToHot = 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? TierToHotDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).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? TierToHotDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).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? TierToHotDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).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? TierToHotDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModificationInternal)TierToHot).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? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastAccessTimeGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { 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? TierToColdDaysAfterModificationGreaterThan { 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; } + /// 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? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastAccessTimeGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { 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? TierToHotDaysAfterModificationGreaterThan { get; set; } + + } + /// Management policy action for base blob. + internal partial interface IManagementPolicyBaseBlobInternal + + { + /// The function to delete the blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 cold storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToCold { get; set; } + /// Value indicating the age in days after blob creation. + float? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastAccessTimeGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToColdDaysAfterModificationGreaterThan { get; set; } + /// The function to tier blobs to cool storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterModification TierToHot { get; set; } + /// Value indicating the age in days after blob creation. + float? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastAccessTimeGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToHotDaysAfterModificationGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.json.cs new file mode 100644 index 000000000000..cf6d6fd1825a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyBaseBlob.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.Api20230501 +{ + 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.Api20230501.IManagementPolicyBaseBlob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyBaseBlob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.DateAfterModification.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification.FromJson(__jsonTierToArchive) : TierToArchive;} + {_tierToCold = If( json?.PropertyT("tierToCold"), out var __jsonTierToCold) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification.FromJson(__jsonTierToCold) : TierToCold;} + {_tierToHot = If( json?.PropertyT("tierToHot"), out var __jsonTierToHot) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterModification.FromJson(__jsonTierToHot) : TierToHot;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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._tierToCold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCold.ToJson(null,serializationMode) : null, "tierToCold" ,container.Add ); + AddIf( null != this._tierToHot ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToHot.ToJson(null,serializationMode) : null, "tierToHot" ,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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.PowerShell.cs new file mode 100644 index 000000000000..674a64551382 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.TypeConverter.cs new file mode 100644 index 000000000000..344a7918fac3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.cs new file mode 100644 index 000000000000..c2f0b30f038d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyAction Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyAction()); set => this._action = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilter[] FilterBlobIndexMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)Filter).BlobIndexMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyFilterInternal)Filter).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)Filter).PrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyAction Action { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyDefinition.json.cs new file mode 100644 index 000000000000..7ffa20d47387 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ManagementPolicyFilter.FromJson(__jsonFilters) : Filter;} + {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..d5961bed0025 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("BlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("BlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal)this).BlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..c4ea3cc66484 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.cs new file mode 100644 index 000000000000..b02787105636 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyFilter.json.cs new file mode 100644 index 000000000000..8f77b9aecdf7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilter) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..ed0bbaea6bee --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..18873fea1e0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.cs new file mode 100644 index 000000000000..e0dcd3f1ccea --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ManagementPolicy properties. + public partial class ManagementPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyPropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicySchema()); set { {_policy = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySchema Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchemaInternal)Policy).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyRule[] PolicyRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyProperties.json.cs new file mode 100644 index 000000000000..a1d96ceafeab --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..0b61618797cb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction) content.GetValueForProperty("DefinitionAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction) content.GetValueForProperty("DefinitionAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).DefinitionAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..5d2028e5f5ca --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.cs new file mode 100644 index 000000000000..8f0004b5a0bd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyAction DefinitionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)Definition).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilter[] FilterBlobIndexMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)Definition).FilterBlobIndexMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyDefinitionInternal)Definition).FilterBlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyDefinitionInternal)Definition).FilterPrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)Definition).FilterPrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinition Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ManagementPolicyDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for DefinitionFilter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRuleInternal.DefinitionFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)Definition).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyDefinitionInternal)Definition).Filter = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyDefinition Definition { get; set; } + /// An object that defines the action set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyAction DefinitionAction { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyRule.json.cs new file mode 100644 index 000000000000..b465d3520e15 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.PowerShell.cs new file mode 100644 index 000000000000..e027a83d177e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.TypeConverter.cs new file mode 100644 index 000000000000..db5c3d85981f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicySchema ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.cs new file mode 100644 index 000000000000..c6f4e51be79e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicySchema, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchemaInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule[] Rule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySchema.json.cs new file mode 100644 index 000000000000..2e7d73730558 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicySchema. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySchema. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.PowerShell.cs new file mode 100644 index 000000000000..ae98f015e41c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicySnapShotInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.TypeConverter.cs new file mode 100644 index 000000000000..6a4ab798f09f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicySnapShot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.cs new file mode 100644 index 000000000000..494e07821614 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for snapshot. + public partial class ManagementPolicySnapShot : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreation Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Internal Acessors for Delete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal.TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToCold = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToCool = value;} } } + + /// Internal Acessors for TierToHot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShotInternal.TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToHot = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToArchive; + + /// The function to tier blob snapshot to archive storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToCold; + + /// The function to tier blobs to cold storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set => this._tierToCold = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToColdDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).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? TierToColdDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToCool; + + /// The function to tier blob snapshot to cool storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToHot; + + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set => this._tierToHot = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToHotDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).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? TierToHotDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).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? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { 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; } + /// 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? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + + } + /// Management policy action for snapshot. + internal partial interface IManagementPolicySnapShotInternal + + { + /// The function to delete the blob snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 blobs to cold storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCold { get; set; } + /// Value indicating the age in days after creation + float? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { get; set; } + /// The function to tier blob snapshot to cool storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToHot { get; set; } + /// Value indicating the age in days after creation + float? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.json.cs new file mode 100644 index 000000000000..56f4e2c98633 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicySnapShot.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.Api20230501 +{ + 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.Api20230501.IManagementPolicySnapShot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicySnapShot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.DateAfterCreation.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToArchive) : TierToArchive;} + {_tierToCold = If( json?.PropertyT("tierToCold"), out var __jsonTierToCold) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToCold) : TierToCold;} + {_tierToHot = If( json?.PropertyT("tierToHot"), out var __jsonTierToHot) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToHot) : TierToHot;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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._tierToCold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCold.ToJson(null,serializationMode) : null, "tierToCold" ,container.Add ); + AddIf( null != this._tierToHot ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToHot.ToJson(null,serializationMode) : null, "tierToHot" ,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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.PowerShell.cs new file mode 100644 index 000000000000..c49243d08906 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IManagementPolicyVersionInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToCold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToHot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("TierToHot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToColdDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToColdDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToColdDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToColdDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToHotDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToHotDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToHotDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).TierToHotDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.TypeConverter.cs new file mode 100644 index 000000000000..ca754f641dfb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IManagementPolicyVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.cs new file mode 100644 index 000000000000..ffc18363ccf4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.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.Api20230501 +{ + 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.Api20230501.IManagementPolicyVersion, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreation Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Internal Acessors for Delete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal.TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToCold = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToCool = value;} } } + + /// Internal Acessors for TierToHot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersionInternal.TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set { {_tierToHot = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToArchive; + + /// The function to tier blob version to archive storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToCold; + + /// The function to tier blobs to cold storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCold { get => (this._tierToCold = this._tierToCold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set => this._tierToCold = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToColdDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).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? TierToColdDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCold).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToCool; + + /// The function to tier blob version to cool storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation _tierToHot; + + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToHot { get => (this._tierToHot = this._tierToHot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation()); set => this._tierToHot = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToHotDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).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? TierToHotDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreationInternal)TierToHot).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? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { 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; } + /// 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? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { 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.Api20230501.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. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 blobs to cold storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToCold { get; set; } + /// Value indicating the age in days after creation + float? TierToColdDaysAfterCreationGreaterThan { 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? TierToColdDaysAfterLastTierChangeGreaterThan { get; set; } + /// The function to tier blob version to cool storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDateAfterCreation TierToHot { get; set; } + /// Value indicating the age in days after creation + float? TierToHotDaysAfterCreationGreaterThan { 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? TierToHotDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.json.cs new file mode 100644 index 000000000000..d809354b3fbb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ManagementPolicyVersion.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.Api20230501 +{ + 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.Api20230501.IManagementPolicyVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IManagementPolicyVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.DateAfterCreation.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToArchive) : TierToArchive;} + {_tierToCold = If( json?.PropertyT("tierToCold"), out var __jsonTierToCold) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToCold) : TierToCold;} + {_tierToHot = If( json?.PropertyT("tierToHot"), out var __jsonTierToHot) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DateAfterCreation.FromJson(__jsonTierToHot) : TierToHot;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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._tierToCold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCold.ToJson(null,serializationMode) : null, "tierToCold" ,container.Add ); + AddIf( null != this._tierToHot ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToHot.ToJson(null,serializationMode) : null, "tierToHot" ,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.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.PowerShell.cs new file mode 100644 index 000000000000..c3b1847e5431 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.DimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.TypeConverter.cs new file mode 100644 index 000000000000..2c867672cda1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IMetricSpecification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.cs new file mode 100644 index 000000000000..4b5535a20037 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Metric specification of operation. + public partial class MetricSpecification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/MetricSpecification.json.cs new file mode 100644 index 000000000000..6332451d25ed --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IMetricSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Multichannel.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Multichannel.PowerShell.cs new file mode 100644 index 000000000000..c923a9b70dd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IMultichannelInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMultichannelInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Multichannel.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Multichannel.TypeConverter.cs new file mode 100644 index 000000000000..8b12e85c5151 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IMultichannel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Multichannel.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Multichannel.cs new file mode 100644 index 000000000000..50df60146a2a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IMultichannel, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Multichannel.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Multichannel.json.cs new file mode 100644 index 000000000000..6c933cf70e42 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IMultichannel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.PowerShell.cs new file mode 100644 index 000000000000..f36c3ed83d9f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.INetworkRuleSetInternal)this).Bypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("Bypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).Bypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("ResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).ResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("ResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).ResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).VirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("VirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).VirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("IPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).IPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("IPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).IPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).DefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("DefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)this).Bypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("Bypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).Bypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("ResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).ResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("ResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).ResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).VirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("VirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).VirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("IPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).IPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("IPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).IPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)this).DefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("DefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.TypeConverter.cs new file mode 100644 index 000000000000..999af8e3e5ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.INetworkRuleSet ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.cs new file mode 100644 index 000000000000..229035f2166c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Network rule set + public partial class NetworkRuleSet : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] IPRule { get => this._iPRule; set => this._iPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] ResourceAccessRule { get => this._resourceAccessRule; set => this._resourceAccessRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] IPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] ResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] VirtualNetworkRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkRuleSet.json.cs new file mode 100644 index 000000000000..50243a73545f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.INetworkRuleSet. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.PowerShell.cs new file mode 100644 index 000000000000..d426d0c54aaa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// NetworkSecurityPerimeter related information + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterTypeConverter))] + public partial class NetworkSecurityPerimeter + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeter(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.Api20230501.INetworkSecurityPerimeter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeter(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.Api20230501.INetworkSecurityPerimeter 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 NetworkSecurityPerimeter(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.Api20230501.INetworkSecurityPerimeterInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).PerimeterGuid = (string) content.GetValueForProperty("PerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).PerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Location, 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 NetworkSecurityPerimeter(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.Api20230501.INetworkSecurityPerimeterInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).PerimeterGuid = (string) content.GetValueForProperty("PerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).PerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)this).Location, 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(); + } + /// NetworkSecurityPerimeter related information + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterTypeConverter))] + public partial interface INetworkSecurityPerimeter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.TypeConverter.cs new file mode 100644 index 000000000000..f867cef79a35 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterTypeConverter : 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.Api20230501.INetworkSecurityPerimeter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeter.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.cs new file mode 100644 index 000000000000..339dbcb46470 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// NetworkSecurityPerimeter related information + public partial class NetworkSecurityPerimeter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal + { + + /// Backing field for property. + private string _id; + + /// The ARM identifier of the resource + [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 string _location; + + /// Location of the resource + [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 string _perimeterGuid; + + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PerimeterGuid { get => this._perimeterGuid; set => this._perimeterGuid = value; } + + /// Creates an new instance. + public NetworkSecurityPerimeter() + { + + } + } + /// NetworkSecurityPerimeter related information + public partial interface INetworkSecurityPerimeter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The ARM identifier of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier of the resource", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Location of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the resource", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Guid of the resource", + SerializedName = @"perimeterGuid", + PossibleTypes = new [] { typeof(string) })] + string PerimeterGuid { get; set; } + + } + /// NetworkSecurityPerimeter related information + internal partial interface INetworkSecurityPerimeterInternal + + { + /// The ARM identifier of the resource + string Id { get; set; } + /// Location of the resource + string Location { get; set; } + /// Guid of the resource + string PerimeterGuid { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.json.cs new file mode 100644 index 000000000000..d872bd2103f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeter.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// NetworkSecurityPerimeter related information + public partial class NetworkSecurityPerimeter + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeter(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 NetworkSecurityPerimeter(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;} + {_perimeterGuid = If( json?.PropertyT("perimeterGuid"), out var __jsonPerimeterGuid) ? (string)__jsonPerimeterGuid : (string)PerimeterGuid;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + 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._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 ); + AddIf( null != (((object)this._perimeterGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._perimeterGuid.ToString()) : null, "perimeterGuid" ,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; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.PowerShell.cs new file mode 100644 index 000000000000..98a340c96e04 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.PowerShell.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.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Network Security Perimeter configuration resource. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationTypeConverter))] + public partial class NetworkSecurityPerimeterConfiguration + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfiguration(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.Api20230501.INetworkSecurityPerimeterConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfiguration(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.Api20230501.INetworkSecurityPerimeterConfiguration 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 NetworkSecurityPerimeterConfiguration(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.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) content.GetValueForProperty("ResourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Profile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("ProvisioningIssue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningIssue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[]) content.GetValueForProperty("ProvisioningIssue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningIssue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterId = (string) content.GetValueForProperty("NetworkSecurityPerimeterId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterId, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterLocation = (string) content.GetValueForProperty("NetworkSecurityPerimeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterLocation, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationAccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationAccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("ResourceAssociationAccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationAccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.CreateFrom); + } + if (content.Contains("NetworkSecurityPerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterGuid = (string) content.GetValueForProperty("NetworkSecurityPerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationName = (string) content.GetValueForProperty("ResourceAssociationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationName, global::System.Convert.ToString); + } + if (content.Contains("ProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileName = (string) content.GetValueForProperty("ProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileName, global::System.Convert.ToString); + } + if (content.Contains("ProfileAccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRulesVersion = (float?) content.GetValueForProperty("ProfileAccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("ProfileAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ProfileDiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileDiagnosticSettingsVersion = (float?) content.GetValueForProperty("ProfileDiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileDiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileEnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileEnabledLogCategory = (string[]) content.GetValueForProperty("ProfileEnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileEnabledLogCategory, __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 NetworkSecurityPerimeterConfiguration(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.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) content.GetValueForProperty("ResourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).Profile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("ProvisioningIssue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningIssue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[]) content.GetValueForProperty("ProvisioningIssue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProvisioningIssue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterId = (string) content.GetValueForProperty("NetworkSecurityPerimeterId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterId, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterLocation = (string) content.GetValueForProperty("NetworkSecurityPerimeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterLocation, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationAccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationAccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("ResourceAssociationAccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationAccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.CreateFrom); + } + if (content.Contains("NetworkSecurityPerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterGuid = (string) content.GetValueForProperty("NetworkSecurityPerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).NetworkSecurityPerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationName = (string) content.GetValueForProperty("ResourceAssociationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ResourceAssociationName, global::System.Convert.ToString); + } + if (content.Contains("ProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileName = (string) content.GetValueForProperty("ProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileName, global::System.Convert.ToString); + } + if (content.Contains("ProfileAccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRulesVersion = (float?) content.GetValueForProperty("ProfileAccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("ProfileAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ProfileDiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileDiagnosticSettingsVersion = (float?) content.GetValueForProperty("ProfileDiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileDiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileEnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileEnabledLogCategory = (string[]) content.GetValueForProperty("ProfileEnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal)this).ProfileEnabledLogCategory, __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 Network Security Perimeter configuration resource. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationTypeConverter))] + public partial interface INetworkSecurityPerimeterConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..1955f78c9fe8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationTypeConverter : 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.Api20230501.INetworkSecurityPerimeterConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfiguration.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.cs new file mode 100644 index 000000000000..ca8c7b3286c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.cs @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Network Security Perimeter configuration resource. + public partial class NetworkSecurityPerimeterConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + + /// Internal Acessors for NetworkSecurityPerimeter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.NetworkSecurityPerimeter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeter = value; } + + /// Internal Acessors for Profile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.Profile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).Profile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).Profile = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningIssue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.ProvisioningIssue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningIssue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningIssue = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for ResourceAssociation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationInternal.ResourceAssociation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociation = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterGuid = value ?? null; } + + /// The ARM identifier of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterId = value ?? null; } + + /// Location of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).NetworkSecurityPerimeterLocation = value ?? null; } + + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileAccessRule = value ?? null /* arrayOf */; } + + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? ProfileAccessRulesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileAccessRulesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileAccessRulesVersion = value ?? default(float); } + + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? ProfileDiagnosticSettingsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileDiagnosticSettingsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileDiagnosticSettingsVersion = value ?? default(float); } + + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] ProfileEnabledLogCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileEnabledLogCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileEnabledLogCategory = value ?? null /* arrayOf */; } + + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProfileName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties _property; + + /// Properties of the Network Security Perimeter Configuration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationProperties()); } + + /// List of Provisioning Issues if any + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningIssue; } + + /// Provisioning state of Network Security Perimeter configuration propagation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ProvisioningState; } + + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociationAccessMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociationAccessMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode)""); } + + /// Name of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ResourceAssociationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)Property).ResourceAssociationName = value ?? null; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = 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.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = 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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; } + + /// Creates an new instance. + public NetworkSecurityPerimeterConfiguration() + { + + } + + /// 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(__resourceAutoGenerated), __resourceAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); + } + } + /// The Network Security Perimeter configuration resource. + public partial interface INetworkSecurityPerimeterConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated + { + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Guid of the resource", + SerializedName = @"perimeterGuid", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterGuid { get; set; } + /// The ARM identifier of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier of the resource", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterId { get; set; } + /// Location of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the resource", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterLocation { get; set; } + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Access Rules", + SerializedName = @"accessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get; set; } + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current access rules version", + SerializedName = @"accessRulesVersion", + PossibleTypes = new [] { typeof(float) })] + float? ProfileAccessRulesVersion { get; set; } + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Diagnostic settings version", + SerializedName = @"diagnosticSettingsVersion", + PossibleTypes = new [] { typeof(float) })] + float? ProfileDiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enabled logging categories", + SerializedName = @"enabledLogCategories", + PossibleTypes = new [] { typeof(string) })] + string[] ProfileEnabledLogCategory { get; set; } + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ProfileName { get; set; } + /// List of Provisioning Issues if any + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Provisioning Issues if any", + SerializedName = @"provisioningIssues", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get; } + /// Provisioning state of Network Security Perimeter configuration propagation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of Network Security Perimeter configuration propagation", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Mode of the resource association", + SerializedName = @"accessMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get; set; } + /// Name of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource association", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ResourceAssociationName { get; set; } + + } + /// The Network Security Perimeter configuration resource. + internal partial interface INetworkSecurityPerimeterConfigurationInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal + { + /// NetworkSecurityPerimeter related information + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } + /// Guid of the resource + string NetworkSecurityPerimeterGuid { get; set; } + /// The ARM identifier of the resource + string NetworkSecurityPerimeterId { get; set; } + /// Location of the resource + string NetworkSecurityPerimeterLocation { get; set; } + /// Network Security Perimeter profile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile Profile { get; set; } + /// List of Access Rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get; set; } + /// Current access rules version + float? ProfileAccessRulesVersion { get; set; } + /// Diagnostic settings version + float? ProfileDiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + string[] ProfileEnabledLogCategory { get; set; } + /// Name of the resource + string ProfileName { get; set; } + /// Properties of the Network Security Perimeter Configuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties Property { get; set; } + /// List of Provisioning Issues if any + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get; set; } + /// Provisioning state of Network Security Perimeter configuration propagation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; set; } + /// Information about resource association + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ResourceAssociation { get; set; } + /// Access Mode of the resource association + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get; set; } + /// Name of the resource association + string ResourceAssociationName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.json.cs new file mode 100644 index 000000000000..b05511f2cc21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfiguration.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Network Security Perimeter configuration resource. + public partial class NetworkSecurityPerimeterConfiguration + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfiguration(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 NetworkSecurityPerimeterConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationProperties.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; + } + __resourceAutoGenerated?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + 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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.PowerShell.cs new file mode 100644 index 000000000000..6ddb07712ab9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Result of the List Network Security Perimeter configuration operation. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationListTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationList + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfigurationList(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.Api20230501.INetworkSecurityPerimeterConfigurationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfigurationList(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.Api20230501.INetworkSecurityPerimeterConfigurationList 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 NetworkSecurityPerimeterConfigurationList(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.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)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 NetworkSecurityPerimeterConfigurationList(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.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal)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(); + } + /// Result of the List Network Security Perimeter configuration operation. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationListTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.TypeConverter.cs new file mode 100644 index 000000000000..061cf852cc42 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationListTypeConverter : 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.Api20230501.INetworkSecurityPerimeterConfigurationList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfigurationList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationList.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.cs new file mode 100644 index 000000000000..77266e645625 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Result of the List Network Security Perimeter configuration operation. + public partial class NetworkSecurityPerimeterConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationList, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URI that can be used to request the next set of paged results. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[] _value; + + /// A collection of Network Security Perimeter configurations + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[] Value { get => this._value; } + + /// + /// Creates an new instance. + /// + public NetworkSecurityPerimeterConfigurationList() + { + + } + } + /// Result of the List Network Security Perimeter configuration operation. + public partial interface INetworkSecurityPerimeterConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The URI that can be used to request the next set of paged results. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URI that can be used to request the next set of paged results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Network Security Perimeter configurations + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A collection of Network Security Perimeter configurations", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[] Value { get; } + + } + /// Result of the List Network Security Perimeter configuration operation. + internal partial interface INetworkSecurityPerimeterConfigurationListInternal + + { + /// The URI that can be used to request the next set of paged results. + string NextLink { get; set; } + /// A collection of Network Security Perimeter configurations + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.json.cs new file mode 100644 index 000000000000..09f36f67f3ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationList.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Result of the List Network Security Perimeter configuration operation. + public partial class NetworkSecurityPerimeterConfigurationList + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationList(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 NetworkSecurityPerimeterConfigurationList(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.Api20230501.INetworkSecurityPerimeterConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfiguration.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); + } + } + 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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.PowerShell.cs new file mode 100644 index 000000000000..d65d819e03c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.PowerShell.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the Network Security Perimeter Configuration + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationProperties + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfigurationProperties(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.Api20230501.INetworkSecurityPerimeterConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfigurationProperties(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.Api20230501.INetworkSecurityPerimeterConfigurationProperties 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 NetworkSecurityPerimeterConfigurationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) content.GetValueForProperty("ResourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).Profile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("ProvisioningIssue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningIssue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[]) content.GetValueForProperty("ProvisioningIssue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningIssue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterId = (string) content.GetValueForProperty("NetworkSecurityPerimeterId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterId, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterLocation = (string) content.GetValueForProperty("NetworkSecurityPerimeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterLocation, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationAccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationAccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("ResourceAssociationAccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationAccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.CreateFrom); + } + if (content.Contains("NetworkSecurityPerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterGuid = (string) content.GetValueForProperty("NetworkSecurityPerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationName = (string) content.GetValueForProperty("ResourceAssociationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationName, global::System.Convert.ToString); + } + if (content.Contains("ProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileName = (string) content.GetValueForProperty("ProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileName, global::System.Convert.ToString); + } + if (content.Contains("ProfileAccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRulesVersion = (float?) content.GetValueForProperty("ProfileAccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("ProfileAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ProfileDiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileDiagnosticSettingsVersion = (float?) content.GetValueForProperty("ProfileDiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileDiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileEnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileEnabledLogCategory = (string[]) content.GetValueForProperty("ProfileEnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileEnabledLogCategory, __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 NetworkSecurityPerimeterConfigurationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) content.GetValueForProperty("ResourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).Profile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("ProvisioningIssue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningIssue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[]) content.GetValueForProperty("ProvisioningIssue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProvisioningIssue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterId = (string) content.GetValueForProperty("NetworkSecurityPerimeterId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterId, global::System.Convert.ToString); + } + if (content.Contains("NetworkSecurityPerimeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterLocation = (string) content.GetValueForProperty("NetworkSecurityPerimeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterLocation, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationAccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationAccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("ResourceAssociationAccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationAccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.CreateFrom); + } + if (content.Contains("NetworkSecurityPerimeterGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterGuid = (string) content.GetValueForProperty("NetworkSecurityPerimeterGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).NetworkSecurityPerimeterGuid, global::System.Convert.ToString); + } + if (content.Contains("ResourceAssociationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationName = (string) content.GetValueForProperty("ResourceAssociationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ResourceAssociationName, global::System.Convert.ToString); + } + if (content.Contains("ProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileName = (string) content.GetValueForProperty("ProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileName, global::System.Convert.ToString); + } + if (content.Contains("ProfileAccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRulesVersion = (float?) content.GetValueForProperty("ProfileAccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("ProfileAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ProfileDiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileDiagnosticSettingsVersion = (float?) content.GetValueForProperty("ProfileDiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileDiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ProfileEnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileEnabledLogCategory = (string[]) content.GetValueForProperty("ProfileEnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal)this).ProfileEnabledLogCategory, __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 the Network Security Perimeter Configuration + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.TypeConverter.cs new file mode 100644 index 000000000000..fee4f49189f1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.TypeConverter.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationPropertiesTypeConverter : 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.Api20230501.INetworkSecurityPerimeterConfigurationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfigurationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationProperties.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.cs new file mode 100644 index 000000000000..1b48def05973 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the Network Security Perimeter Configuration + public partial class NetworkSecurityPerimeterConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal + { + + /// Internal Acessors for NetworkSecurityPerimeter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal.NetworkSecurityPerimeter { get => (this._networkSecurityPerimeter = this._networkSecurityPerimeter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter()); set { {_networkSecurityPerimeter = value;} } } + + /// Internal Acessors for Profile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal.Profile { get => (this._profile = this._profile ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfile()); set { {_profile = value;} } } + + /// Internal Acessors for ProvisioningIssue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal.ProvisioningIssue { get => this._provisioningIssue; set { {_provisioningIssue = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for ResourceAssociation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesInternal.ResourceAssociation { get => (this._resourceAssociation = this._resourceAssociation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation()); set { {_resourceAssociation = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter _networkSecurityPerimeter; + + /// NetworkSecurityPerimeter related information + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter NetworkSecurityPerimeter { get => (this._networkSecurityPerimeter = this._networkSecurityPerimeter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter()); } + + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).PerimeterGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).PerimeterGuid = value ?? null; } + + /// The ARM identifier of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).Id = value ?? null; } + + /// Location of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NetworkSecurityPerimeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterInternal)NetworkSecurityPerimeter).Location = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile _profile; + + /// Network Security Perimeter profile + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile Profile { get => (this._profile = this._profile ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfile()); } + + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).AccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).AccessRule = value ?? null /* arrayOf */; } + + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? ProfileAccessRulesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).AccessRulesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).AccessRulesVersion = value ?? default(float); } + + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? ProfileDiagnosticSettingsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).DiagnosticSettingsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).DiagnosticSettingsVersion = value ?? default(float); } + + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] ProfileEnabledLogCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).EnabledLogCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).EnabledLogCategory = value ?? null /* arrayOf */; } + + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)Profile).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] _provisioningIssue; + + /// List of Provisioning Issues if any + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get => this._provisioningIssue; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? _provisioningState; + + /// Provisioning state of Network Security Perimeter configuration propagation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation _resourceAssociation; + + /// Information about resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ResourceAssociation { get => (this._resourceAssociation = this._resourceAssociation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation()); } + + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)ResourceAssociation).AccessMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)ResourceAssociation).AccessMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode)""); } + + /// Name of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ResourceAssociationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)ResourceAssociation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)ResourceAssociation).Name = value ?? null; } + + /// + /// Creates an new instance. + /// + public NetworkSecurityPerimeterConfigurationProperties() + { + + } + } + /// Properties of the Network Security Perimeter Configuration + public partial interface INetworkSecurityPerimeterConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Guid of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Guid of the resource", + SerializedName = @"perimeterGuid", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterGuid { get; set; } + /// The ARM identifier of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier of the resource", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterId { get; set; } + /// Location of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the resource", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterLocation { get; set; } + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Access Rules", + SerializedName = @"accessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get; set; } + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current access rules version", + SerializedName = @"accessRulesVersion", + PossibleTypes = new [] { typeof(float) })] + float? ProfileAccessRulesVersion { get; set; } + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Diagnostic settings version", + SerializedName = @"diagnosticSettingsVersion", + PossibleTypes = new [] { typeof(float) })] + float? ProfileDiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enabled logging categories", + SerializedName = @"enabledLogCategories", + PossibleTypes = new [] { typeof(string) })] + string[] ProfileEnabledLogCategory { get; set; } + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ProfileName { get; set; } + /// List of Provisioning Issues if any + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Provisioning Issues if any", + SerializedName = @"provisioningIssues", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get; } + /// Provisioning state of Network Security Perimeter configuration propagation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of Network Security Perimeter configuration propagation", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Mode of the resource association", + SerializedName = @"accessMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get; set; } + /// Name of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource association", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ResourceAssociationName { get; set; } + + } + /// Properties of the Network Security Perimeter Configuration + internal partial interface INetworkSecurityPerimeterConfigurationPropertiesInternal + + { + /// NetworkSecurityPerimeter related information + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } + /// Guid of the resource + string NetworkSecurityPerimeterGuid { get; set; } + /// The ARM identifier of the resource + string NetworkSecurityPerimeterId { get; set; } + /// Location of the resource + string NetworkSecurityPerimeterLocation { get; set; } + /// Network Security Perimeter profile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile Profile { get; set; } + /// List of Access Rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] ProfileAccessRule { get; set; } + /// Current access rules version + float? ProfileAccessRulesVersion { get; set; } + /// Diagnostic settings version + float? ProfileDiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + string[] ProfileEnabledLogCategory { get; set; } + /// Name of the resource + string ProfileName { get; set; } + /// List of Provisioning Issues if any + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue[] ProvisioningIssue { get; set; } + /// Provisioning state of Network Security Perimeter configuration propagation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; set; } + /// Information about resource association + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ResourceAssociation { get; set; } + /// Access Mode of the resource association + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? ResourceAssociationAccessMode { get; set; } + /// Name of the resource association + string ResourceAssociationName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.json.cs new file mode 100644 index 000000000000..4056ce6deee5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the Network Security Perimeter Configuration + public partial class NetworkSecurityPerimeterConfigurationProperties + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationProperties(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 NetworkSecurityPerimeterConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_networkSecurityPerimeter = If( json?.PropertyT("networkSecurityPerimeter"), out var __jsonNetworkSecurityPerimeter) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter.FromJson(__jsonNetworkSecurityPerimeter) : NetworkSecurityPerimeter;} + {_resourceAssociation = If( json?.PropertyT("resourceAssociation"), out var __jsonResourceAssociation) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.FromJson(__jsonResourceAssociation) : ResourceAssociation;} + {_profile = If( json?.PropertyT("profile"), out var __jsonProfile) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterConfigurationPropertiesProfile.FromJson(__jsonProfile) : Profile;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_provisioningIssue = If( json?.PropertyT("provisioningIssues"), out var __jsonProvisioningIssues) ? If( __jsonProvisioningIssues 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.Api20230501.IProvisioningIssue) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssue.FromJson(__u) )) ))() : null : ProvisioningIssue;} + 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._networkSecurityPerimeter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._networkSecurityPerimeter.ToJson(null,serializationMode) : null, "networkSecurityPerimeter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resourceAssociation ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._resourceAssociation.ToJson(null,serializationMode) : null, "resourceAssociation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._profile ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._profile.ToJson(null,serializationMode) : null, "profile" ,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)) + { + if (null != this._provisioningIssue) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._provisioningIssue ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("provisioningIssues",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.PowerShell.cs new file mode 100644 index 000000000000..c31e29e3098d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.PowerShell.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.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Network Security Perimeter profile + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfigurationPropertiesProfile(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfigurationPropertiesProfile(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile 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 NetworkSecurityPerimeterConfigurationPropertiesProfile(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRulesVersion = (float?) content.GetValueForProperty("AccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("AccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("AccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).DiagnosticSettingsVersion = (float?) content.GetValueForProperty("DiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).DiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("EnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).EnabledLogCategory = (string[]) content.GetValueForProperty("EnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).EnabledLogCategory, __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 NetworkSecurityPerimeterConfigurationPropertiesProfile(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AccessRulesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRulesVersion = (float?) content.GetValueForProperty("AccessRulesVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRulesVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("AccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[]) content.GetValueForProperty("AccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).AccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DiagnosticSettingsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).DiagnosticSettingsVersion = (float?) content.GetValueForProperty("DiagnosticSettingsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).DiagnosticSettingsVersion, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("EnabledLogCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).EnabledLogCategory = (string[]) content.GetValueForProperty("EnabledLogCategory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal)this).EnabledLogCategory, __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(); + } + /// Network Security Perimeter profile + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationPropertiesProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.TypeConverter.cs new file mode 100644 index 000000000000..1ae3f83635e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.TypeConverter.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfileTypeConverter : 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfigurationPropertiesProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationPropertiesProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationPropertiesProfile.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs new file mode 100644 index 000000000000..c266cdb3b324 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Network Security Perimeter profile + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] _accessRule; + + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] AccessRule { get => this._accessRule; set => this._accessRule = value; } + + /// Backing field for property. + private float? _accessRulesVersion; + + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? AccessRulesVersion { get => this._accessRulesVersion; set => this._accessRulesVersion = value; } + + /// Backing field for property. + private float? _diagnosticSettingsVersion; + + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DiagnosticSettingsVersion { get => this._diagnosticSettingsVersion; set => this._diagnosticSettingsVersion = value; } + + /// Backing field for property. + private string[] _enabledLogCategory; + + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] EnabledLogCategory { get => this._enabledLogCategory; set => this._enabledLogCategory = value; } + + /// Backing field for property. + private string _name; + + /// Name of the resource + [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 NetworkSecurityPerimeterConfigurationPropertiesProfile() + { + + } + } + /// Network Security Perimeter profile + public partial interface INetworkSecurityPerimeterConfigurationPropertiesProfile : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of Access Rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Access Rules", + SerializedName = @"accessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] AccessRule { get; set; } + /// Current access rules version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current access rules version", + SerializedName = @"accessRulesVersion", + PossibleTypes = new [] { typeof(float) })] + float? AccessRulesVersion { get; set; } + /// Diagnostic settings version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Diagnostic settings version", + SerializedName = @"diagnosticSettingsVersion", + PossibleTypes = new [] { typeof(float) })] + float? DiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enabled logging categories", + SerializedName = @"enabledLogCategories", + PossibleTypes = new [] { typeof(string) })] + string[] EnabledLogCategory { get; set; } + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Network Security Perimeter profile + internal partial interface INetworkSecurityPerimeterConfigurationPropertiesProfileInternal + + { + /// List of Access Rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule[] AccessRule { get; set; } + /// Current access rules version + float? AccessRulesVersion { get; set; } + /// Diagnostic settings version + float? DiagnosticSettingsVersion { get; set; } + /// Enabled logging categories + string[] EnabledLogCategory { get; set; } + /// Name of the resource + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.json.cs new file mode 100644 index 000000000000..8fb58a7a4748 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesProfile.json.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Network Security Perimeter profile + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationPropertiesProfile(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 NetworkSecurityPerimeterConfigurationPropertiesProfile(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;} + {_accessRulesVersion = If( json?.PropertyT("accessRulesVersion"), out var __jsonAccessRulesVersion) ? (float?)__jsonAccessRulesVersion : AccessRulesVersion;} + {_accessRule = If( json?.PropertyT("accessRules"), out var __jsonAccessRules) ? If( __jsonAccessRules 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.Api20230501.INspAccessRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRule.FromJson(__u) )) ))() : null : AccessRule;} + {_diagnosticSettingsVersion = If( json?.PropertyT("diagnosticSettingsVersion"), out var __jsonDiagnosticSettingsVersion) ? (float?)__jsonDiagnosticSettingsVersion : DiagnosticSettingsVersion;} + {_enabledLogCategory = If( json?.PropertyT("enabledLogCategories"), out var __jsonEnabledLogCategories) ? If( __jsonEnabledLogCategories 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 : EnabledLogCategory;} + 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 != this._accessRulesVersion ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._accessRulesVersion) : null, "accessRulesVersion" ,container.Add ); + if (null != this._accessRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._accessRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("accessRules",__w); + } + AddIf( null != this._diagnosticSettingsVersion ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._diagnosticSettingsVersion) : null, "diagnosticSettingsVersion" ,container.Add ); + if (null != this._enabledLogCategory) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._enabledLogCategory ) + { + 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("enabledLogCategories",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.PowerShell.cs new file mode 100644 index 000000000000..81901d82aca5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Information about resource association + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation 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 NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).AccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).AccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).AccessMode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode?) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal)this).AccessMode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode.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(); + } + /// Information about resource association + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.TypeConverter.cs new file mode 100644 index 000000000000..6a31ea6257b6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.TypeConverter.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociationTypeConverter : 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.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.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs new file mode 100644 index 000000000000..4fdbe37ed6cf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Information about resource association + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? _accessMode; + + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? AccessMode { get => this._accessMode; set => this._accessMode = value; } + + /// Backing field for property. + private string _name; + + /// Name of the resource association + [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 NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation() + { + + } + } + /// Information about resource association + public partial interface INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Access Mode of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Mode of the resource association", + SerializedName = @"accessMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? AccessMode { get; set; } + /// Name of the resource association + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource association", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Information about resource association + internal partial interface INetworkSecurityPerimeterConfigurationPropertiesResourceAssociationInternal + + { + /// Access Mode of the resource association + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode? AccessMode { get; set; } + /// Name of the resource association + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.json.cs new file mode 100644 index 000000000000..0cb5c23d5736 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Information about resource association + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + { + + /// + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfigurationPropertiesResourceAssociation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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 NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(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;} + {_accessMode = If( json?.PropertyT("accessMode"), out var __jsonAccessMode) ? (string)__jsonAccessMode : (string)AccessMode;} + 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._accessMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessMode.ToString()) : null, "accessMode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.PowerShell.cs new file mode 100644 index 000000000000..ee910ac44850 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Information of Access Rule in Network Security Perimeter profile + [System.ComponentModel.TypeConverter(typeof(NspAccessRuleTypeConverter))] + public partial class NspAccessRule + { + + /// + /// 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.Api20230501.INspAccessRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NspAccessRule(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.Api20230501.INspAccessRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NspAccessRule(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.Api20230501.INspAccessRule 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 NspAccessRule(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.Api20230501.INspAccessRuleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection.CreateFrom); + } + if (content.Contains("AddressPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).AddressPrefix = (string[]) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).AddressPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[]) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Subscription, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[]) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).NetworkSecurityPerimeter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom)); + } + if (content.Contains("FullyQualifiedDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).FullyQualifiedDomainName = (string[]) content.GetValueForProperty("FullyQualifiedDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).FullyQualifiedDomainName, __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 NspAccessRule(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.Api20230501.INspAccessRuleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection.CreateFrom); + } + if (content.Contains("AddressPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).AddressPrefix = (string[]) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).AddressPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[]) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).Subscription, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[]) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).NetworkSecurityPerimeter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom)); + } + if (content.Contains("FullyQualifiedDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).FullyQualifiedDomainName = (string[]) content.GetValueForProperty("FullyQualifiedDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal)this).FullyQualifiedDomainName, __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(); + } + /// Information of Access Rule in Network Security Perimeter profile + [System.ComponentModel.TypeConverter(typeof(NspAccessRuleTypeConverter))] + public partial interface INspAccessRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.TypeConverter.cs new file mode 100644 index 000000000000..31910f8af89b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NspAccessRuleTypeConverter : 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.Api20230501.INspAccessRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NspAccessRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NspAccessRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NspAccessRule.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.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.cs new file mode 100644 index 000000000000..3142dcdb5d64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Information of Access Rule in Network Security Perimeter profile + public partial class NspAccessRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal + { + + /// Address prefixes in the CIDR format for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] AddressPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).AddressPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).AddressPrefix = value ?? null /* arrayOf */; } + + /// Direction of Access Rule + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).Direction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).Direction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection)""); } + + /// FQDN for outbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FullyQualifiedDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).FullyQualifiedDomainName; } + + /// Internal Acessors for FullyQualifiedDomainName + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal.FullyQualifiedDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).FullyQualifiedDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).FullyQualifiedDomainName = value; } + + /// Internal Acessors for NetworkSecurityPerimeter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal.NetworkSecurityPerimeter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).NetworkSecurityPerimeter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).NetworkSecurityPerimeter = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleProperties()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// NetworkSecurityPerimeters for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).NetworkSecurityPerimeter; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties _property; + + /// Properties of Access Rule + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRuleProperties()); } + + /// Subscriptions for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)Property).Subscription = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public NspAccessRule() + { + + } + } + /// Information of Access Rule in Network Security Perimeter profile + public partial interface INspAccessRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Address prefixes in the CIDR format for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Address prefixes in the CIDR format for inbound rules", + SerializedName = @"addressPrefixes", + PossibleTypes = new [] { typeof(string) })] + string[] AddressPrefix { get; set; } + /// Direction of Access Rule + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of Access Rule", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get; set; } + /// FQDN for outbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"FQDN for outbound rules", + SerializedName = @"fullyQualifiedDomainNames", + PossibleTypes = new [] { typeof(string) })] + string[] FullyQualifiedDomainName { get; } + /// Name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// NetworkSecurityPerimeters for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"NetworkSecurityPerimeters for inbound rules", + SerializedName = @"networkSecurityPerimeters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get; } + /// Subscriptions for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscriptions for inbound rules", + SerializedName = @"subscriptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get; set; } + + } + /// Information of Access Rule in Network Security Perimeter profile + internal partial interface INspAccessRuleInternal + + { + /// Address prefixes in the CIDR format for inbound rules + string[] AddressPrefix { get; set; } + /// Direction of Access Rule + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get; set; } + /// FQDN for outbound rules + string[] FullyQualifiedDomainName { get; set; } + /// Name of the resource + string Name { get; set; } + /// NetworkSecurityPerimeters for inbound rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get; set; } + /// Properties of Access Rule + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties Property { get; set; } + /// Subscriptions for inbound rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.json.cs new file mode 100644 index 000000000000..6a9684e712c0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRule.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Information of Access Rule in Network Security Perimeter profile + public partial class NspAccessRule + { + + /// + /// 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.Api20230501.INspAccessRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NspAccessRule(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 NspAccessRule(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.Api20230501.NspAccessRuleProperties.FromJson(__jsonProperties) : Property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + 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._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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.PowerShell.cs new file mode 100644 index 000000000000..e5799de9baaa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of Access Rule + [System.ComponentModel.TypeConverter(typeof(NspAccessRulePropertiesTypeConverter))] + public partial class NspAccessRuleProperties + { + + /// + /// 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.Api20230501.INspAccessRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NspAccessRuleProperties(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.Api20230501.INspAccessRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NspAccessRuleProperties(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.Api20230501.INspAccessRuleProperties 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 NspAccessRuleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection.CreateFrom); + } + if (content.Contains("AddressPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).AddressPrefix = (string[]) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).AddressPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[]) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Subscription, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[]) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).NetworkSecurityPerimeter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom)); + } + if (content.Contains("FullyQualifiedDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).FullyQualifiedDomainName = (string[]) content.GetValueForProperty("FullyQualifiedDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).FullyQualifiedDomainName, __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 NspAccessRuleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection.CreateFrom); + } + if (content.Contains("AddressPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).AddressPrefix = (string[]) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).AddressPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[]) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).Subscription, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkSecurityPerimeter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).NetworkSecurityPerimeter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[]) content.GetValueForProperty("NetworkSecurityPerimeter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).NetworkSecurityPerimeter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeterTypeConverter.ConvertFrom)); + } + if (content.Contains("FullyQualifiedDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).FullyQualifiedDomainName = (string[]) content.GetValueForProperty("FullyQualifiedDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal)this).FullyQualifiedDomainName, __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 Access Rule + [System.ComponentModel.TypeConverter(typeof(NspAccessRulePropertiesTypeConverter))] + public partial interface INspAccessRuleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.TypeConverter.cs new file mode 100644 index 000000000000..4433cd62c0b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NspAccessRulePropertiesTypeConverter : 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.Api20230501.INspAccessRuleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NspAccessRuleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NspAccessRuleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NspAccessRuleProperties.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.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.cs new file mode 100644 index 000000000000..9c86556b8692 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of Access Rule + public partial class NspAccessRuleProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal + { + + /// Backing field for property. + private string[] _addressPrefix; + + /// Address prefixes in the CIDR format for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] AddressPrefix { get => this._addressPrefix; set => this._addressPrefix = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? _direction; + + /// Direction of Access Rule + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get => this._direction; set => this._direction = value; } + + /// Backing field for property. + private string[] _fullyQualifiedDomainName; + + /// FQDN for outbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] FullyQualifiedDomainName { get => this._fullyQualifiedDomainName; } + + /// Internal Acessors for FullyQualifiedDomainName + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal.FullyQualifiedDomainName { get => this._fullyQualifiedDomainName; set { {_fullyQualifiedDomainName = value;} } } + + /// Internal Acessors for NetworkSecurityPerimeter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesInternal.NetworkSecurityPerimeter { get => this._networkSecurityPerimeter; set { {_networkSecurityPerimeter = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] _networkSecurityPerimeter; + + /// NetworkSecurityPerimeters for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get => this._networkSecurityPerimeter; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] _subscription; + + /// Subscriptions for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get => this._subscription; set => this._subscription = value; } + + /// Creates an new instance. + public NspAccessRuleProperties() + { + + } + } + /// Properties of Access Rule + public partial interface INspAccessRuleProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Address prefixes in the CIDR format for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Address prefixes in the CIDR format for inbound rules", + SerializedName = @"addressPrefixes", + PossibleTypes = new [] { typeof(string) })] + string[] AddressPrefix { get; set; } + /// Direction of Access Rule + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of Access Rule", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get; set; } + /// FQDN for outbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"FQDN for outbound rules", + SerializedName = @"fullyQualifiedDomainNames", + PossibleTypes = new [] { typeof(string) })] + string[] FullyQualifiedDomainName { get; } + /// NetworkSecurityPerimeters for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"NetworkSecurityPerimeters for inbound rules", + SerializedName = @"networkSecurityPerimeters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get; } + /// Subscriptions for inbound rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscriptions for inbound rules", + SerializedName = @"subscriptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get; set; } + + } + /// Properties of Access Rule + internal partial interface INspAccessRulePropertiesInternal + + { + /// Address prefixes in the CIDR format for inbound rules + string[] AddressPrefix { get; set; } + /// Direction of Access Rule + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection? Direction { get; set; } + /// FQDN for outbound rules + string[] FullyQualifiedDomainName { get; set; } + /// NetworkSecurityPerimeters for inbound rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeter[] NetworkSecurityPerimeter { get; set; } + /// Subscriptions for inbound rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem[] Subscription { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.json.cs new file mode 100644 index 000000000000..77c0ee97fcd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRuleProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of Access Rule + public partial class NspAccessRuleProperties + { + + /// + /// 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.Api20230501.INspAccessRuleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NspAccessRuleProperties(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 NspAccessRuleProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)Direction;} + {_addressPrefix = If( json?.PropertyT("addressPrefixes"), out var __jsonAddressPrefixes) ? If( __jsonAddressPrefixes 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 : AddressPrefix;} + {_subscription = If( json?.PropertyT("subscriptions"), out var __jsonSubscriptions) ? If( __jsonSubscriptions 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.Api20230501.INspAccessRulePropertiesSubscriptionsItem) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NspAccessRulePropertiesSubscriptionsItem.FromJson(__p) )) ))() : null : Subscription;} + {_networkSecurityPerimeter = If( json?.PropertyT("networkSecurityPerimeters"), out var __jsonNetworkSecurityPerimeters) ? If( __jsonNetworkSecurityPerimeters 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.Api20230501.INetworkSecurityPerimeter) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkSecurityPerimeter.FromJson(__k) )) ))() : null : NetworkSecurityPerimeter;} + {_fullyQualifiedDomainName = If( json?.PropertyT("fullyQualifiedDomainNames"), out var __jsonFullyQualifiedDomainNames) ? If( __jsonFullyQualifiedDomainNames 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 : FullyQualifiedDomainName;} + 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._direction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._direction.ToString()) : null, "direction" ,container.Add ); + if (null != this._addressPrefix) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._addressPrefix ) + { + 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("addressPrefixes",__w); + } + if (null != this._subscription) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._subscription ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("subscriptions",__r); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._networkSecurityPerimeter) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._networkSecurityPerimeter ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("networkSecurityPerimeters",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._fullyQualifiedDomainName) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __i in this._fullyQualifiedDomainName ) + { + 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("fullyQualifiedDomainNames",__h); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.PowerShell.cs new file mode 100644 index 000000000000..455737cc674d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Subscription for inbound rule + [System.ComponentModel.TypeConverter(typeof(NspAccessRulePropertiesSubscriptionsItemTypeConverter))] + public partial class NspAccessRulePropertiesSubscriptionsItem + { + + /// + /// 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.Api20230501.INspAccessRulePropertiesSubscriptionsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NspAccessRulePropertiesSubscriptionsItem(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.Api20230501.INspAccessRulePropertiesSubscriptionsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NspAccessRulePropertiesSubscriptionsItem(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.Api20230501.INspAccessRulePropertiesSubscriptionsItem 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 NspAccessRulePropertiesSubscriptionsItem(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.Api20230501.INspAccessRulePropertiesSubscriptionsItemInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItemInternal)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 NspAccessRulePropertiesSubscriptionsItem(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.Api20230501.INspAccessRulePropertiesSubscriptionsItemInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItemInternal)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(); + } + /// Subscription for inbound rule + [System.ComponentModel.TypeConverter(typeof(NspAccessRulePropertiesSubscriptionsItemTypeConverter))] + public partial interface INspAccessRulePropertiesSubscriptionsItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.TypeConverter.cs new file mode 100644 index 000000000000..66caa285edf9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NspAccessRulePropertiesSubscriptionsItemTypeConverter : 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.Api20230501.INspAccessRulePropertiesSubscriptionsItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NspAccessRulePropertiesSubscriptionsItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NspAccessRulePropertiesSubscriptionsItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NspAccessRulePropertiesSubscriptionsItem.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.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.cs new file mode 100644 index 000000000000..bf508bbcf477 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Subscription for inbound rule + public partial class NspAccessRulePropertiesSubscriptionsItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItemInternal + { + + /// Backing field for property. + private string _id; + + /// The ARM identifier of subscription + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// + /// Creates an new instance. + /// + public NspAccessRulePropertiesSubscriptionsItem() + { + + } + } + /// Subscription for inbound rule + public partial interface INspAccessRulePropertiesSubscriptionsItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The ARM identifier of subscription + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier of subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// Subscription for inbound rule + internal partial interface INspAccessRulePropertiesSubscriptionsItemInternal + + { + /// The ARM identifier of subscription + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.json.cs new file mode 100644 index 000000000000..8f90f1fa0ed5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/NspAccessRulePropertiesSubscriptionsItem.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Subscription for inbound rule + public partial class NspAccessRulePropertiesSubscriptionsItem + { + + /// + /// 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.Api20230501.INspAccessRulePropertiesSubscriptionsItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INspAccessRulePropertiesSubscriptionsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NspAccessRulePropertiesSubscriptionsItem(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 NspAccessRulePropertiesSubscriptionsItem(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; + } + 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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.PowerShell.cs new file mode 100644 index 000000000000..6347ff5a50dc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPoliciesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPoliciesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPoliciesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPoliciesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.TypeConverter.cs new file mode 100644 index 000000000000..788268e10253 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicies ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.cs new file mode 100644 index 000000000000..426a65f5379b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicies, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPoliciesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicy[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicies.json.cs new file mode 100644 index 000000000000..8bb2f72cfbe9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicies. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicies. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.PowerShell.cs new file mode 100644 index 000000000000..22c85f008092 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.TypeConverter.cs new file mode 100644 index 000000000000..e66904db4427 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.cs new file mode 100644 index 000000000000..4913e7dbb7d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).DestinationAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyInternal.EnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).EnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).EnabledTime = value; } + + /// Internal Acessors for PolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal.PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyRule[] Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)Property).SourceAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyProperties Property { get; set; } + /// The storage account object replication rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicy.json.cs new file mode 100644 index 000000000000..78b0a6ee9665 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..a1e56ad3e870 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime = (string) content.GetValueForProperty("MinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime = (string) content.GetValueForProperty("MinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..23606421eb06 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.cs new file mode 100644 index 000000000000..ede85ce24d87 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyFilter.json.cs new file mode 100644 index 000000000000..1e001fa9d7cc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..40e9d1fd16f8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..8952e7f14dbf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.cs new file mode 100644 index 000000000000..04b0877b72a0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ObjectReplicationPolicy properties. + public partial class ObjectReplicationPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyPropertiesInternal.EnabledTime { get => this._enabledTime; set { {_enabledTime = value;} } } + + /// Internal Acessors for PolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyProperties.json.cs new file mode 100644 index 000000000000..a0488d73a8bc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..094c504f3b61 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyRuleInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).RuleId = (string) content.GetValueForProperty("RuleId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).RuleId, global::System.Convert.ToString); + } + if (content.Contains("SourceContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).SourceContainer = (string) content.GetValueForProperty("SourceContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).SourceContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterMinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime = (string) content.GetValueForProperty("FilterMinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyRuleInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ObjectReplicationPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).RuleId = (string) content.GetValueForProperty("RuleId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).RuleId, global::System.Convert.ToString); + } + if (content.Contains("SourceContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).SourceContainer = (string) content.GetValueForProperty("SourceContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).SourceContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterMinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime = (string) content.GetValueForProperty("FilterMinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..36a5d3f6bceb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.cs new file mode 100644 index 000000000000..ee61415d0cbe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyFilterInternal)Filter).MinCreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IObjectReplicationPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilterInternal)Filter).PrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRuleInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ObjectReplicationPolicyRule.json.cs new file mode 100644 index 000000000000..a622ccd32848 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IObjectReplicationPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IObjectReplicationPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Operation.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Operation.PowerShell.cs new file mode 100644 index 000000000000..6b2cd12f6829 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("PropertyServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).PropertyServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification) content.GetValueForProperty("PropertyServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).PropertyServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("PropertyServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).PropertyServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification) content.GetValueForProperty("PropertyServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).PropertyServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Operation.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Operation.TypeConverter.cs new file mode 100644 index 000000000000..544539eda265 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Operation.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Operation.cs new file mode 100644 index 000000000000..3139855064d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage REST API operation definition. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.OperationProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationInternal.PropertyServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IOperationProperties Property { get; set; } + /// One property of operation, include metric specifications. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification PropertyServiceSpecification { get; set; } + /// Metric specifications of operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Operation.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Operation.json.cs new file mode 100644 index 000000000000..120147d10552 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.OperationDisplay.FromJson(__jsonDisplay) : Display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..8937d9cef948 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..f1a2891b1529 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.cs new file mode 100644 index 000000000000..844cade9888e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationDisplay.json.cs new file mode 100644 index 000000000000..81fa8547c7d9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..6682362f98b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..2166fec755bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationListResult.cs new file mode 100644 index 000000000000..e0348f3f4d6b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationListResult.json.cs new file mode 100644 index 000000000000..ae9f68831ade --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationProperties.PowerShell.cs new file mode 100644 index 000000000000..2e080e931177 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationProperties.TypeConverter.cs new file mode 100644 index 000000000000..1db46993c88e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/OperationProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationProperties.cs new file mode 100644 index 000000000000..a17105d00760 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal + { + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ServiceSpecification()); set { {_serviceSpecification = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSpecification ServiceSpecification { get; set; } + /// Metric specifications of operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/OperationProperties.json.cs new file mode 100644 index 000000000000..f37424cbc86e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IOperationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PermissionScope.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PermissionScope.PowerShell.cs new file mode 100644 index 000000000000..9b099af912ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPermissionScopeInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Permission, global::System.Convert.ToString); + } + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Service = (string) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Service, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPermissionScopeInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Permission, global::System.Convert.ToString); + } + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Service = (string) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).Service, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScopeInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PermissionScope.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PermissionScope.TypeConverter.cs new file mode 100644 index 000000000000..d1b85bff791e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPermissionScope ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PermissionScope.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PermissionScope.cs new file mode 100644 index 000000000000..b1640d85dab1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PermissionScope.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.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class PermissionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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), Create (c), Modify + /// Ownership (o), and Modify Permissions (p). + /// + [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), Create (c), Modify + /// Ownership (o), and Modify Permissions (p). + /// + [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), Create (c), Modify Ownership (o), and Modify Permissions (p).", + 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), Create (c), Modify + /// Ownership (o), and Modify Permissions (p). + /// + 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.DefaultTag/generated/api/Models/Api20230501/PermissionScope.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PermissionScope.json.cs new file mode 100644 index 000000000000..534d83540300 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPermissionScope. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPermissionScope. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.PowerShell.cs new file mode 100644 index 000000000000..e594b087108d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.TypeConverter.cs new file mode 100644 index 000000000000..fccfd0ef7cae --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.cs new file mode 100644 index 000000000000..74069aed7f95 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint resource. + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..fa59b6cc7e71 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.PowerShell.cs new file mode 100644 index 000000000000..a0f0b85a4e6e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.TypeConverter.cs new file mode 100644 index 000000000000..b40b0e1b8922 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..172c7ff4757d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint Connection resource. + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..e12960358f9d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.PowerShell.cs new file mode 100644 index 000000000000..fc3509e3acce --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.TypeConverter.cs new file mode 100644 index 000000000000..954a8e9e5cf7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..a5973f85c6e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnection[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..aa3881ae078b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnectionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.PowerShell.cs new file mode 100644 index 000000000000..394e78b8bd86 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.TypeConverter.cs new file mode 100644 index 000000000000..73b0c2af2dbe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..8251f3b16bd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal + { + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointInternal)PrivateEndpoint).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..a5bf82bf564a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateEndpointConnectionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnectionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.PowerShell.cs new file mode 100644 index 000000000000..dddf7701fdd4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.TypeConverter.cs new file mode 100644 index 000000000000..28a29e29566b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.cs new file mode 100644 index 000000000000..215b314acd1a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateLinkResourceProperties()); set { {_property = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourceProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..5ebfb683708f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.PowerShell.cs new file mode 100644 index 000000000000..019641eb06dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.TypeConverter.cs new file mode 100644 index 000000000000..820522b32db3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..7aac3684d941 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceListResult.json.cs new file mode 100644 index 000000000000..f3e770439e6f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.PowerShell.cs new file mode 100644 index 000000000000..9a9673ef8471 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.TypeConverter.cs new file mode 100644 index 000000000000..b2bc526f0654 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..c8bd8007d1e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkResourceProperties.json.cs new file mode 100644 index 000000000000..e2748bb181a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkResourceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkResourceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.PowerShell.cs new file mode 100644 index 000000000000..983e9606c023 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired = (string) content.GetValueForProperty("ActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired = (string) content.GetValueForProperty("ActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.TypeConverter.cs new file mode 100644 index 000000000000..f87c06d1fa65 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..6501b80ece9a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..23589bdc62fc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IPrivateLinkServiceConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateLinkServiceConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.PowerShell.cs new file mode 100644 index 000000000000..bbab20ce98c2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistoryInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.TypeConverter.cs new file mode 100644 index 000000000000..5aa8b83068cd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IProtectedAppendWritesHistory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.cs new file mode 100644 index 000000000000..2db4af6e6560 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IProtectedAppendWritesHistory, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtectedAppendWritesHistory.json.cs new file mode 100644 index 000000000000..52e86d13f23e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IProtectedAppendWritesHistory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtectedAppendWritesHistory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.PowerShell.cs new file mode 100644 index 000000000000..197271c7afb4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IProtocolSettingsInternal)this).Smb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("Smb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).Smb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IProtocolSettingsInternal)this).Smb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting) content.GetValueForProperty("Smb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).Smb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.TypeConverter.cs new file mode 100644 index 000000000000..9795ec35a3e7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IProtocolSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.cs new file mode 100644 index 000000000000..31c2b54fcade --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Protocol settings for file service + public partial class ProtocolSettings : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal + { + + /// Internal Acessors for Smb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal.Smb { get => (this._smb = this._smb ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SmbSetting()); set { {_smb = value;} } } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettingsInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)Smb).Multichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)Smb).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)Smb).MultichannelEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSetting Smb { get => (this._smb = this._smb ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)Smb).AuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)Smb).ChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)Smb).KerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)Smb).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProtocolSettings.json.cs new file mode 100644 index 000000000000..8bf7195500fd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IProtocolSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProtocolSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.PowerShell.cs new file mode 100644 index 000000000000..65b7af77f2fa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + [System.ComponentModel.TypeConverter(typeof(ProvisioningIssueTypeConverter))] + public partial class ProvisioningIssue + { + + /// + /// 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.Api20230501.IProvisioningIssue DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProvisioningIssue(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.Api20230501.IProvisioningIssue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProvisioningIssue(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.Api20230501.IProvisioningIssue 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 ProvisioningIssue(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.Api20230501.IProvisioningIssueInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IssueType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).IssueType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType?) content.GetValueForProperty("IssueType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).IssueType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)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 ProvisioningIssue(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.Api20230501.IProvisioningIssueInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IssueType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).IssueType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType?) content.GetValueForProperty("IssueType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).IssueType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal)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(); + } + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + [System.ComponentModel.TypeConverter(typeof(ProvisioningIssueTypeConverter))] + public partial interface IProvisioningIssue + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.TypeConverter.cs new file mode 100644 index 000000000000..198bb29650e6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProvisioningIssueTypeConverter : 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.Api20230501.IProvisioningIssue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProvisioningIssue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProvisioningIssue.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProvisioningIssue.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.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.cs new file mode 100644 index 000000000000..f42fae076d0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + public partial class ProvisioningIssue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal + { + + /// Description of the issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).Description = value ?? null; } + + /// Type of issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).IssueType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).IssueType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType)""); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueProperties()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the issue + [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.Models.Api20230501.IProvisioningIssueProperties _property; + + /// Properties of provisioning issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ProvisioningIssueProperties()); } + + /// Severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)Property).Severity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity)""); } + + /// Creates an new instance. + public ProvisioningIssue() + { + + } + } + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + public partial interface IProvisioningIssue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Description of the issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the issue", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Type of issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of issue", + SerializedName = @"issueType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get; set; } + /// Name of the issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the issue", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the issue.", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get; set; } + + } + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + internal partial interface IProvisioningIssueInternal + + { + /// Description of the issue + string Description { get; set; } + /// Type of issue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get; set; } + /// Name of the issue + string Name { get; set; } + /// Properties of provisioning issue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties Property { get; set; } + /// Severity of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.json.cs new file mode 100644 index 000000000000..89d1d74970d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssue.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Describes provisioning issue for given NetworkSecurityPerimeterConfiguration + public partial class ProvisioningIssue + { + + /// + /// 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.Api20230501.IProvisioningIssue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProvisioningIssue(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 ProvisioningIssue(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.Api20230501.ProvisioningIssueProperties.FromJson(__jsonProperties) : Property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + 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._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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.PowerShell.cs new file mode 100644 index 000000000000..56ea26143455 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of provisioning issue + [System.ComponentModel.TypeConverter(typeof(ProvisioningIssuePropertiesTypeConverter))] + public partial class ProvisioningIssueProperties + { + + /// + /// 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.Api20230501.IProvisioningIssueProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProvisioningIssueProperties(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.Api20230501.IProvisioningIssueProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProvisioningIssueProperties(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.Api20230501.IProvisioningIssueProperties 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 ProvisioningIssueProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IssueType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).IssueType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType?) content.GetValueForProperty("IssueType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).IssueType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)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 ProvisioningIssueProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IssueType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).IssueType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType?) content.GetValueForProperty("IssueType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).IssueType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal)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(); + } + /// Properties of provisioning issue + [System.ComponentModel.TypeConverter(typeof(ProvisioningIssuePropertiesTypeConverter))] + public partial interface IProvisioningIssueProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.TypeConverter.cs new file mode 100644 index 000000000000..27898b178ed3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProvisioningIssuePropertiesTypeConverter : 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.Api20230501.IProvisioningIssueProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProvisioningIssueProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProvisioningIssueProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProvisioningIssueProperties.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.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.cs new file mode 100644 index 000000000000..1727a50c9113 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of provisioning issue + public partial class ProvisioningIssueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssuePropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the issue + [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.IssueType? _issueType; + + /// Type of issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get => this._issueType; set => this._issueType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? _severity; + + /// Severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get => this._severity; set => this._severity = value; } + + /// Creates an new instance. + public ProvisioningIssueProperties() + { + + } + } + /// Properties of provisioning issue + public partial interface IProvisioningIssueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Description of the issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the issue", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Type of issue + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of issue", + SerializedName = @"issueType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get; set; } + /// Severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the issue.", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get; set; } + + } + /// Properties of provisioning issue + internal partial interface IProvisioningIssuePropertiesInternal + + { + /// Description of the issue + string Description { get; set; } + /// Type of issue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType? IssueType { get; set; } + /// Severity of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity? Severity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.json.cs new file mode 100644 index 000000000000..64caa00cb593 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ProvisioningIssueProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of provisioning issue + public partial class ProvisioningIssueProperties + { + + /// + /// 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.Api20230501.IProvisioningIssueProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IProvisioningIssueProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProvisioningIssueProperties(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 ProvisioningIssueProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_issueType = If( json?.PropertyT("issueType"), out var __jsonIssueType) ? (string)__jsonIssueType : (string)IssueType;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + {_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._issueType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._issueType.ToString()) : null, "issueType" ,container.Add ); + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,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.DefaultTag/generated/api/Models/Api20230501/QueueProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueProperties.PowerShell.cs new file mode 100644 index 000000000000..caf22fa1d6d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)this).ApproximateMessageCount = (int?) content.GetValueForProperty("ApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)this).ApproximateMessageCount = (int?) content.GetValueForProperty("ApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueProperties.TypeConverter.cs new file mode 100644 index 000000000000..56cf14f2943d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueProperties.cs new file mode 100644 index 000000000000..944c62ef378a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class QueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueuePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for ApproximateMessageCount + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueuePropertiesMetadata Metadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueProperties.json.cs new file mode 100644 index 000000000000..f88adbe3799c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..28a0167ae685 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..f16df654d20b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueuePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.cs new file mode 100644 index 000000000000..b851b9eb825e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueuePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..4b2ec62cd513 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.QueuePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueuePropertiesMetadata.json.cs new file mode 100644 index 000000000000..c7b2db3ece1e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueuePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..ea5f84c97ff9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IQueueServicePropertiesInternal)this).QueueServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGenerated) content.GetValueForProperty("QueueServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).QueueServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("QueueServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServicePropertiesInternal)this).QueueServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGenerated) content.GetValueForProperty("QueueServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).QueueServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("QueueServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..c86b87e5e69c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.cs new file mode 100644 index 000000000000..46fe34b92167 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal.QueueServiceProperty { get => (this._queueServiceProperty = this._queueServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueServicePropertiesAutoGenerated()); set { {_queueServiceProperty = value;} } } + + /// Internal Acessors for QueueServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesInternal.QueueServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueueServicePropertiesAutoGenerated QueueServiceProperty { get => (this._queueServiceProperty = this._queueServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of a storage account’s Queue service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules QueueServicePropertyCor { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServiceProperties.json.cs new file mode 100644 index 000000000000..661755008c23 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..9052e1d0aa85 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..7f921c3bc9b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..b06b567e0869 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/QueueServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..592603185d45 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IQueueServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.PowerShell.cs new file mode 100644 index 000000000000..91cf8bce93f4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IResourceAccessRuleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRuleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRuleInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRuleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRuleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRuleInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.TypeConverter.cs new file mode 100644 index 000000000000..cb759b6073f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IResourceAccessRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.cs new file mode 100644 index 000000000000..2d14002cb1fe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Resource Access Rule. + public partial class ResourceAccessRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ResourceAccessRule.json.cs new file mode 100644 index 000000000000..09c6094ce363 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IResourceAccessRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..3ffbf0ff5ab5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)this).MinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("MinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyPropertiesInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal)this).MinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("MinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..a2043be5cf11 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestorePolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.cs new file mode 100644 index 000000000000..b88957ad353f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestorePolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestorePolicyPropertiesInternal.LastEnabledTime { get => this._lastEnabledTime; set { {_lastEnabledTime = value;} } } + + /// Internal Acessors for MinRestoreTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RestorePolicyProperties.json.cs new file mode 100644 index 000000000000..b3cfe5fb621a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestorePolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestorePolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Restriction.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Restriction.PowerShell.cs new file mode 100644 index 000000000000..1d78ca5e2516 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Restriction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Restriction.TypeConverter.cs new file mode 100644 index 000000000000..8824d85cf2c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestriction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Restriction.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Restriction.cs new file mode 100644 index 000000000000..b5d4e95369c7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestriction, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestrictionInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Value + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Restriction.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Restriction.json.cs new file mode 100644 index 000000000000..5662d71c4906 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRestriction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestriction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.PowerShell.cs new file mode 100644 index 000000000000..c95cae34e2ec --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IRoutingPreferenceInternal)this).RoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).RoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("PublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("PublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishInternetEndpoint = (bool?) content.GetValueForProperty("PublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)this).RoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).RoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("PublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("PublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)this).PublishInternetEndpoint = (bool?) content.GetValueForProperty("PublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.TypeConverter.cs new file mode 100644 index 000000000000..bb14badef2d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRoutingPreference ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.cs new file mode 100644 index 000000000000..f90ce8537cfd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRoutingPreference, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/RoutingPreference.json.cs new file mode 100644 index 000000000000..25d2c2de799f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IRoutingPreference. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SasPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SasPolicy.PowerShell.cs new file mode 100644 index 000000000000..aa50cd64f74a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISasPolicyInternal)this).SasExpirationPeriod = (string) content.GetValueForProperty("SasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).SasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("ExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).ExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("ExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).ExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + 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.Api20230501.ISasPolicyInternal)this).SasExpirationPeriod = (string) content.GetValueForProperty("SasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).SasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("ExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).ExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("ExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)this).ExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.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(); + } + /// 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.DefaultTag/generated/api/Models/Api20230501/SasPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SasPolicy.TypeConverter.cs new file mode 100644 index 000000000000..d4d380019e0d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISasPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SasPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SasPolicy.cs new file mode 100644 index 000000000000..efc581781e52 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SasPolicy.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.Api20230501 +{ + 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.Api20230501.ISasPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction _expirationAction; + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction ExpirationAction { get => this._expirationAction; set => this._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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction ExpirationAction { get; set; } + /// 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction 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.DefaultTag/generated/api/Models/Api20230501/SasPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SasPolicy.json.cs new file mode 100644 index 000000000000..04a60d3479dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISasPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.PowerShell.cs new file mode 100644 index 000000000000..e07264b45aaa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).CanonicalizedResource = (string) content.GetValueForProperty("CanonicalizedResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CanonicalizedResource, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource?) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).Identifier = (string) content.GetValueForProperty("Identifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Identifier, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyStart = (string) content.GetValueForProperty("PartitionKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyStart, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyEnd = (string) content.GetValueForProperty("PartitionKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("RowKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyStart = (string) content.GetValueForProperty("RowKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyStart, global::System.Convert.ToString); + } + if (content.Contains("RowKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyEnd = (string) content.GetValueForProperty("RowKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + if (content.Contains("CacheControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CacheControl = (string) content.GetValueForProperty("CacheControl",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CacheControl, global::System.Convert.ToString); + } + if (content.Contains("ContentDisposition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentDisposition = (string) content.GetValueForProperty("ContentDisposition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentDisposition, global::System.Convert.ToString); + } + if (content.Contains("ContentEncoding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentEncoding = (string) content.GetValueForProperty("ContentEncoding",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentEncoding, global::System.Convert.ToString); + } + if (content.Contains("ContentLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentLanguage = (string) content.GetValueForProperty("ContentLanguage",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentLanguage, global::System.Convert.ToString); + } + if (content.Contains("ContentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).CanonicalizedResource = (string) content.GetValueForProperty("CanonicalizedResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CanonicalizedResource, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource?) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSasParametersInternal)this).Identifier = (string) content.GetValueForProperty("Identifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).Identifier, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyStart = (string) content.GetValueForProperty("PartitionKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyStart, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyEnd = (string) content.GetValueForProperty("PartitionKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).PartitionKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("RowKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyStart = (string) content.GetValueForProperty("RowKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyStart, global::System.Convert.ToString); + } + if (content.Contains("RowKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyEnd = (string) content.GetValueForProperty("RowKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).RowKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + if (content.Contains("CacheControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CacheControl = (string) content.GetValueForProperty("CacheControl",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).CacheControl, global::System.Convert.ToString); + } + if (content.Contains("ContentDisposition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentDisposition = (string) content.GetValueForProperty("ContentDisposition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentDisposition, global::System.Convert.ToString); + } + if (content.Contains("ContentEncoding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentEncoding = (string) content.GetValueForProperty("ContentEncoding",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentEncoding, global::System.Convert.ToString); + } + if (content.Contains("ContentLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentLanguage = (string) content.GetValueForProperty("ContentLanguage",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentLanguage, global::System.Convert.ToString); + } + if (content.Contains("ContentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParametersInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.TypeConverter.cs new file mode 100644 index 000000000000..6bdcd72d243a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSasParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.cs new file mode 100644 index 000000000000..33ff19a20dcb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSasParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSasParameters.json.cs new file mode 100644 index 000000000000..54b68012a325 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSasParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSasParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.PowerShell.cs new file mode 100644 index 000000000000..50090f56208d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.TypeConverter.cs new file mode 100644 index 000000000000..0b20284a26d8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSpecification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.cs new file mode 100644 index 000000000000..919c99861638 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecificationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification[] MetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/ServiceSpecification.json.cs new file mode 100644 index 000000000000..54c8f45537c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IServiceSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IServiceSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.PowerShell.cs new file mode 100644 index 000000000000..400affa8ab4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.TypeConverter.cs new file mode 100644 index 000000000000..b9e37d5093ec --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISignedIdentifier ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.cs new file mode 100644 index 000000000000..1ea4523c0a60 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SignedIdentifier : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy _accessPolicy; + + /// Access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccessPolicy AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)AccessPolicy).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)AccessPolicy).Permission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicyInternal)AccessPolicy).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAccessPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifierInternal.AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SignedIdentifier.json.cs new file mode 100644 index 000000000000..449f6b14f429 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISignedIdentifier. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISignedIdentifier. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Sku.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Sku.PowerShell.cs new file mode 100644 index 000000000000..5e162b7bebd9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Sku.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Sku.TypeConverter.cs new file mode 100644 index 000000000000..7ce870fde869 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Sku.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Sku.cs new file mode 100644 index 000000000000..c12e2accdea8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISku, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal + { + + /// Internal Acessors for Tier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Sku.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Sku.json.cs new file mode 100644 index 000000000000..ae6851d42240 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuCapability.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuCapability.PowerShell.cs new file mode 100644 index 000000000000..b0622272013f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuCapability.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuCapability.TypeConverter.cs new file mode 100644 index 000000000000..10fc62daec11 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISkuCapability ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuCapability.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuCapability.cs new file mode 100644 index 000000000000..ce7a06fcac47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISkuCapability, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapabilityInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuCapability.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuCapability.json.cs new file mode 100644 index 000000000000..c3ab743b2063 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISkuCapability. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapability. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuInformation.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuInformation.PowerShell.cs new file mode 100644 index 000000000000..46201936fa7c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISkuInformationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestriction[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInformationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRestriction[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuInformation.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuInformation.TypeConverter.cs new file mode 100644 index 000000000000..6c42f2ac01e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISkuInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuInformation.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuInformation.cs new file mode 100644 index 000000000000..a084d0029c0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage SKU and its properties + public partial class SkuInformation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISkuCapability[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInformationInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformationInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISkuCapability) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestriction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SkuInformation.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SkuInformation.json.cs new file mode 100644 index 000000000000..580832049f83 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISkuInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuCapability) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRestriction) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SmbSetting.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SmbSetting.PowerShell.cs new file mode 100644 index 000000000000..6a73cd082a43 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISmbSettingInternal)this).Multichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("Multichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Multichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).AuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("KerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).KerberosTicketEncryption = (string) content.GetValueForProperty("KerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).KerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("ChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).ChannelEncryption = (string) content.GetValueForProperty("ChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).ChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISmbSettingInternal)this).Multichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IMultichannel) content.GetValueForProperty("Multichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Multichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).AuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("KerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).KerberosTicketEncryption = (string) content.GetValueForProperty("KerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).KerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("ChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).ChannelEncryption = (string) content.GetValueForProperty("ChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).ChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SmbSetting.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SmbSetting.TypeConverter.cs new file mode 100644 index 000000000000..1641c76aeb49 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISmbSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SmbSetting.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SmbSetting.cs new file mode 100644 index 000000000000..c9216daea233 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Setting for SMB protocol + public partial class SmbSetting : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSettingInternal.Multichannel { get => (this._multichannel = this._multichannel ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Multichannel()); set { {_multichannel = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMultichannel Multichannel { get => (this._multichannel = this._multichannel ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IMultichannelInternal)Multichannel).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SmbSetting.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SmbSetting.json.cs new file mode 100644 index 000000000000..15464caf0299 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISmbSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISmbSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.PowerShell.cs new file mode 100644 index 000000000000..9ec06e91e9f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ISshPublicKeyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKeyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKeyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKeyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.TypeConverter.cs new file mode 100644 index 000000000000..dd956a4b0b54 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISshPublicKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.cs new file mode 100644 index 000000000000..10e21934f4a1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SshPublicKey : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/SshPublicKey.json.cs new file mode 100644 index 000000000000..ae9af148ec53 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ISshPublicKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISshPublicKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccount.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.PowerShell.cs new file mode 100644 index 000000000000..e1fa72efed32 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.PowerShell.cs @@ -0,0 +1,1272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus) content.GetValueForProperty("PropertiesBlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("IsSkuConversionBlocked")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSkuConversionBlocked = (bool?) content.GetValueForProperty("IsSkuConversionBlocked",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSkuConversionBlocked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AccountMigrationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccountMigrationInProgress = (bool?) content.GetValueForProperty("AccountMigrationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccountMigrationInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusStartTime = (string) content.GetValueForProperty("SkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusEndTime = (string) content.GetValueForProperty("SkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatCanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanPlannedFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatPostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("GeoReplicationStatPostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("PropertiesBlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("SkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("SkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus) content.GetValueForProperty("PropertiesBlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("IsSkuConversionBlocked")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSkuConversionBlocked = (bool?) content.GetValueForProperty("IsSkuConversionBlocked",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).IsSkuConversionBlocked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AccountMigrationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccountMigrationInProgress = (bool?) content.GetValueForProperty("AccountMigrationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AccountMigrationInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusStartTime = (string) content.GetValueForProperty("SkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusEndTime = (string) content.GetValueForProperty("SkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatCanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanPlannedFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatCanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatPostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("GeoReplicationStatPostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("PropertiesBlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("SkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("SkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccount.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.TypeConverter.cs new file mode 100644 index 000000000000..dc1f64d5bbb6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccount.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.cs new file mode 100644 index 000000000000..f33824d5d206 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.cs @@ -0,0 +1,2349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account. + public partial class StorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).AccessTier; } + + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AccountMigrationInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AccountMigrationInProgress; } + + /// 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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false + /// 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.Api20230501.IStorageAccountPropertiesInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableExtendedGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).EnableExtendedGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).EnableExtendedGroup = value ?? default(bool); } + + /// 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.Api20230501.IStorageAccountPropertiesInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).EnableNfsV3; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).Encryption; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover; } + + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? GeoReplicationStatCanPlannedFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanPlannedFailover; } + + /// + /// 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.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime; } + + /// The redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostFailoverRedundancy; } + + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostPlannedFailoverRedundancy; } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).IsHnsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).IsSftpEnabled = value ?? default(bool); } + + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsSkuConversionBlocked { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).IsSkuConversionBlocked; } + + [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.Api20230501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternal.AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AccessTier = value; } + + /// Internal Acessors for AccountMigrationInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.AccountMigrationInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AccountMigrationInProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AccountMigrationInProgress = value; } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for BlobRestoreStatusFailureReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusFailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusFailureReason = value; } + + /// Internal Acessors for BlobRestoreStatusParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.BlobRestoreStatusParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusParameter = value; } + + /// Internal Acessors for BlobRestoreStatusRestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusRestoreId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusRestoreId = value; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).CustomDomain = value; } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).Encryption = value; } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for FailoverInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.FailoverInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).FailoverInProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).FailoverInProgress = value; } + + /// Internal Acessors for GeoReplicationStat + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStat = value; } + + /// Internal Acessors for GeoReplicationStatCanFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover = value; } + + /// Internal Acessors for GeoReplicationStatCanPlannedFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatCanPlannedFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanPlannedFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanPlannedFailover = value; } + + /// Internal Acessors for GeoReplicationStatLastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime = value; } + + /// Internal Acessors for GeoReplicationStatPostFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatPostFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostFailoverRedundancy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostFailoverRedundancy = value; } + + /// Internal Acessors for GeoReplicationStatPostPlannedFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatPostPlannedFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostPlannedFailoverRedundancy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatPostPlannedFailoverRedundancy = value; } + + /// Internal Acessors for GeoReplicationStatStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatStatus = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for IsSkuConversionBlocked + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.IsSkuConversionBlocked { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).IsSkuConversionBlocked; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).IsSkuConversionBlocked = value; } + + /// Internal Acessors for KeyCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.KeyCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).KeyCreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).KeyCreationTime = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for Kind + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for LastGeoFailoverTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.LastGeoFailoverTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).LastGeoFailoverTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).LastGeoFailoverTime = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for PrimaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointInternetEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointMicrosoftEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointQueue = value; } + + /// Internal Acessors for PrimaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointTable = value; } + + /// Internal Acessors for PrimaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointWeb = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsBlob = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsDf = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsFile = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsWeb = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsBlob = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsDf = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsFile = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsQueue = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsTable = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsWeb = value; } + + /// Internal Acessors for PrimaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrimaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrimaryLocation = value; } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).PrivateEndpointConnection = value; } + + /// Internal Acessors for PropertiesBlobRestoreStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PropertiesBlobRestoreStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatus = value; } + + /// Internal Acessors for PropertiesBlobRestoreStatusStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.PropertiesBlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SasPolicy = value; } + + /// Internal Acessors for SecondaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointInternetEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointMicrosoftEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointQueue = value; } + + /// Internal Acessors for SecondaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointTable = value; } + + /// Internal Acessors for SecondaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointWeb = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsBlob = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsDf = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsFile = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsWeb = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsBlob = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsDf = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsFile = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsQueue = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsTable = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsWeb = value; } + + /// Internal Acessors for SecondaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SecondaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryLocation = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatus = value; } + + /// Internal Acessors for SkuConversionStatusEndTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusEndTime = value; } + + /// Internal Acessors for SkuConversionStatusSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusSkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusSkuConversionStatus = value; } + + /// Internal Acessors for SkuConversionStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusStartTime = value; } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier = value; } + + /// Internal Acessors for StatusOfPrimary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.StatusOfPrimary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StatusOfPrimary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StatusOfPrimary = value; } + + /// Internal Acessors for StatusOfSecondary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternal.StatusOfSecondary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).StatusOfSecondary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).ParameterBlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ParameterTimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).ProvisioningState; } + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + [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.Api20230501.IStorageAccountPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)Property).SasPolicyExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.IStorageAccountPropertiesInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).SecondaryLocation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusTargetSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If customer initiated account migration is in progress, the value will be true else it will be null.", + SerializedName = @"accountMigrationInProgress", + PossibleTypes = new [] { typeof(bool) })] + bool? AccountMigrationInProgress { 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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// A boolean flag which indicates whether or not planned 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 planned account failover is supported for the account.", + SerializedName = @"canPlannedFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? GeoReplicationStatCanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after an account failover is performed.", + SerializedName = @"postFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after a planned account failover is performed.", + SerializedName = @"postPlannedFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { 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.Api20230501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property will be set to true or false on an event of ongoing migration. Default value is null.", + SerializedName = @"isSkuConversionBlocked", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSkuConversionBlocked { get; } + + [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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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; } + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + bool? AccountMigrationInProgress { 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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.IEncryption Encryption { get; set; } + /// The extendedLocation of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IGeoReplicationStats GeoReplicationStat { get; set; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + bool? GeoReplicationStatCanFailover { get; set; } + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + bool? GeoReplicationStatCanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get; set; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + bool? IsSkuConversionBlocked { get; set; } + /// Storage account keys creation time. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternetEndpoints PrimaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Blob restore status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.Api20230501.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.Api20230501.IStorageAccountInternetEndpoints SecondaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccount.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccount.json.cs new file mode 100644 index 000000000000..88fa5e2e8514 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.Sku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity.FromJson(__jsonIdentity) : Identity;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.PowerShell.cs new file mode 100644 index 000000000000..1d3f9d9960d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.TypeConverter.cs new file mode 100644 index 000000000000..53102a08c159 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCheckNameAvailabilityParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.cs new file mode 100644 index 000000000000..a41d71d0906e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCheckNameAvailabilityParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParametersInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCheckNameAvailabilityParameters.json.cs new file mode 100644 index 000000000000..3601741b520e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCheckNameAvailabilityParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCheckNameAvailabilityParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.PowerShell.cs new file mode 100644 index 000000000000..2e5034f0ceb0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.PowerShell.cs @@ -0,0 +1,682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountCreateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountCreateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountCreateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.TypeConverter.cs new file mode 100644 index 000000000000..2f5716e343c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.cs new file mode 100644 index 000000000000..6bbbcbd647d5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.cs @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false + /// 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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableExtendedGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableExtendedGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableExtendedGroup = value ?? default(bool); } + + /// + /// 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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableNfsV3; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).Encryption = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocationInternal)ExtendedLocation).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).IsHnsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomain = value; } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParameters()); set { {_property = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicy = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesCreateParameters()); set => this._property = value; } + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicyExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicySasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Tier; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountCreateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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.Api20230501.IStorageAccountCreateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// The parameters used to create the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParameters Property { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.Api20230501.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.Api20230501.IStorageAccountCreateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParameters.json.cs new file mode 100644 index 000000000000..8c551b18a276 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.Sku.FromJson(__jsonSku) : Sku;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..776a5e4cb9ac --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..ca436c99546e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.cs new file mode 100644 index 000000000000..85891cdee709 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.dictionary.cs new file mode 100644 index 000000000000..1b89ab4ea581 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.StorageAccountCreateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountCreateParametersTags.json.cs new file mode 100644 index 000000000000..cb4d17f9e24f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountCreateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountCreateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.PowerShell.cs new file mode 100644 index 000000000000..44b37e3baa38 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternetEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternetEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.TypeConverter.cs new file mode 100644 index 000000000000..20ebd63ff9d9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountInternetEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.cs new file mode 100644 index 000000000000..11a90a5a27f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountInternetEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountInternetEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountInternetEndpoints.json.cs new file mode 100644 index 000000000000..fad366dfa05f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountInternetEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.PowerShell.cs new file mode 100644 index 000000000000..f900a34d77b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountKeyInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKeyInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKeyInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.TypeConverter.cs new file mode 100644 index 000000000000..2964650d3fee --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.cs new file mode 100644 index 000000000000..c05e2ea852e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountKey, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKeyInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for KeyName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKeyInternal.Permission { get => this._permission; set { {_permission = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountKey.json.cs new file mode 100644 index 000000000000..f5bda89b4b20 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.PowerShell.cs new file mode 100644 index 000000000000..964178f0614c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountListKeysResultInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKey[]) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListKeysResultInternal)this).Key, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountListKeysResultInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKey[]) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListKeysResultInternal)this).Key, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.TypeConverter.cs new file mode 100644 index 000000000000..9acd49382072 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListKeysResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.cs new file mode 100644 index 000000000000..f3a394a6d055 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListKeysResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListKeysResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKey[] Key { get => this._key; } + + /// Internal Acessors for Key + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountKey[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKey[] Key { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListKeysResult.json.cs new file mode 100644 index 000000000000..a4b5638aa7f9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListKeysResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListKeysResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.PowerShell.cs new file mode 100644 index 000000000000..6cd5a7ec2aaa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.TypeConverter.cs new file mode 100644 index 000000000000..006cfdea9383 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.cs new file mode 100644 index 000000000000..4e1dee906778 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccount[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccount) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccount[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountListResult.json.cs new file mode 100644 index 000000000000..d6d95df75a1d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccount) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.PowerShell.cs new file mode 100644 index 000000000000..31caaf22d9b6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.TypeConverter.cs new file mode 100644 index 000000000000..b3f8d6c81602 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountMicrosoftEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.cs new file mode 100644 index 000000000000..b503279aa2e7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountMicrosoftEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountMicrosoftEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for Queue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal.Queue { get => this._queue; set { {_queue = value;} } } + + /// Internal Acessors for Table + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpointsInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMicrosoftEndpoints.json.cs new file mode 100644 index 000000000000..225dc4ebfa32 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountMicrosoftEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.PowerShell.cs new file mode 100644 index 000000000000..e180901a4e3e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.PowerShell.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountMigrationTypeConverter))] + public partial class StorageAccountMigration + { + + /// + /// 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.Api20230501.IStorageAccountMigration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountMigration(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.Api20230501.IStorageAccountMigration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountMigration(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.Api20230501.IStorageAccountMigration 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 StorageAccountMigration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DetailMigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus?) content.GetValueForProperty("DetailMigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("DetailTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("DetailTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("DetailMigrationFailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedReason = (string) content.GetValueForProperty("DetailMigrationFailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedReason, global::System.Convert.ToString); + } + if (content.Contains("DetailMigrationFailedDetailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedDetailedReason = (string) content.GetValueForProperty("DetailMigrationFailedDetailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedDetailedReason, 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 StorageAccountMigration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DetailMigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus?) content.GetValueForProperty("DetailMigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("DetailTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("DetailTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("DetailMigrationFailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedReason = (string) content.GetValueForProperty("DetailMigrationFailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedReason, global::System.Convert.ToString); + } + if (content.Contains("DetailMigrationFailedDetailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedDetailedReason = (string) content.GetValueForProperty("DetailMigrationFailedDetailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal)this).DetailMigrationFailedDetailedReason, 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 or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + [System.ComponentModel.TypeConverter(typeof(StorageAccountMigrationTypeConverter))] + public partial interface IStorageAccountMigration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.TypeConverter.cs new file mode 100644 index 000000000000..9e0716d3388e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountMigrationTypeConverter : 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.Api20230501.IStorageAccountMigration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountMigration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountMigration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountMigration.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.cs new file mode 100644 index 000000000000..723f83d81438 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + public partial class StorageAccountMigration : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties _detail; + + /// The properties of a storage account’s ongoing or enqueued migration. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationProperties()); set => this._detail = value; } + + /// Reason for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DetailMigrationFailedDetailedReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedDetailedReason; } + + /// Error code for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DetailMigrationFailedReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedReason; } + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? DetailMigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationStatus; } + + /// Target sku name for the account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName DetailTargetSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).TargetSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).TargetSkuName = value ; } + + /// Backing field for property. + private string _id; + + /// Migration Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal.Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationProperties()); set { {_detail = value;} } } + + /// Internal Acessors for DetailMigrationFailedDetailedReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal.DetailMigrationFailedDetailedReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedDetailedReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedDetailedReason = value; } + + /// Internal Acessors for DetailMigrationFailedReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal.DetailMigrationFailedReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationFailedReason = value; } + + /// Internal Acessors for DetailMigrationStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal.DetailMigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)Detail).MigrationStatus = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _name; + + /// current value is 'default' for customer initiated migration + [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; + + /// SrpAccountMigrationType in ARM contract which is 'accountMigrations' + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public StorageAccountMigration() + { + + } + } + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + public partial interface IStorageAccountMigration : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Reason for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reason for migration failure", + SerializedName = @"migrationFailedDetailedReason", + PossibleTypes = new [] { typeof(string) })] + string DetailMigrationFailedDetailedReason { get; } + /// Error code for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code for migration failure", + SerializedName = @"migrationFailedReason", + PossibleTypes = new [] { typeof(string) })] + string DetailMigrationFailedReason { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? DetailMigrationStatus { get; } + /// Target sku name for the account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target sku name for the account", + SerializedName = @"targetSkuName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName DetailTargetSkuName { get; set; } + /// Migration Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration Resource Id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// current value is 'default' for customer initiated migration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current value is 'default' for customer initiated migration", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// SrpAccountMigrationType in ARM contract which is 'accountMigrations' + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SrpAccountMigrationType in ARM contract which is 'accountMigrations'", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + internal partial interface IStorageAccountMigrationInternal + + { + /// The properties of a storage account’s ongoing or enqueued migration. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties Detail { get; set; } + /// Reason for migration failure + string DetailMigrationFailedDetailedReason { get; set; } + /// Error code for migration failure + string DetailMigrationFailedReason { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? DetailMigrationStatus { get; set; } + /// Target sku name for the account + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName DetailTargetSkuName { get; set; } + /// Migration Resource Id + string Id { get; set; } + /// current value is 'default' for customer initiated migration + string Name { get; set; } + /// SrpAccountMigrationType in ARM contract which is 'accountMigrations' + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.json.cs new file mode 100644 index 000000000000..f4da9afb1161 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigration.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + public partial class StorageAccountMigration + { + + /// + /// 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.Api20230501.IStorageAccountMigration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountMigration(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 StorageAccountMigration(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_detail = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigrationProperties.FromJson(__jsonProperties) : Detail;} + {_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; + } + AddIf( null != this._detail ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._detail.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + 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 ); + } + 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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.PowerShell.cs new file mode 100644 index 000000000000..c003c636ccbb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s ongoing or enqueued migration. + [System.ComponentModel.TypeConverter(typeof(StorageAccountMigrationPropertiesTypeConverter))] + public partial class StorageAccountMigrationProperties + { + + /// + /// 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.Api20230501.IStorageAccountMigrationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountMigrationProperties(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.Api20230501.IStorageAccountMigrationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountMigrationProperties(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.Api20230501.IStorageAccountMigrationProperties 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 StorageAccountMigrationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus?) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("MigrationFailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedReason = (string) content.GetValueForProperty("MigrationFailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedReason, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailedDetailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedDetailedReason = (string) content.GetValueForProperty("MigrationFailedDetailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedDetailedReason, 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 StorageAccountMigrationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus?) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("MigrationFailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedReason = (string) content.GetValueForProperty("MigrationFailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedReason, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailedDetailedReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedDetailedReason = (string) content.GetValueForProperty("MigrationFailedDetailedReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal)this).MigrationFailedDetailedReason, 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 properties of a storage account’s ongoing or enqueued migration. + [System.ComponentModel.TypeConverter(typeof(StorageAccountMigrationPropertiesTypeConverter))] + public partial interface IStorageAccountMigrationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.TypeConverter.cs new file mode 100644 index 000000000000..8ae06076a9a4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountMigrationPropertiesTypeConverter : 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.Api20230501.IStorageAccountMigrationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountMigrationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountMigrationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountMigrationProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.cs new file mode 100644 index 000000000000..62241ce00731 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s ongoing or enqueued migration. + public partial class StorageAccountMigrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal + { + + /// Internal Acessors for MigrationFailedDetailedReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal.MigrationFailedDetailedReason { get => this._migrationFailedDetailedReason; set { {_migrationFailedDetailedReason = value;} } } + + /// Internal Acessors for MigrationFailedReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal.MigrationFailedReason { get => this._migrationFailedReason; set { {_migrationFailedReason = value;} } } + + /// Internal Acessors for MigrationStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationPropertiesInternal.MigrationStatus { get => this._migrationStatus; set { {_migrationStatus = value;} } } + + /// Backing field for property. + private string _migrationFailedDetailedReason; + + /// Reason for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string MigrationFailedDetailedReason { get => this._migrationFailedDetailedReason; } + + /// Backing field for property. + private string _migrationFailedReason; + + /// Error code for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string MigrationFailedReason { get => this._migrationFailedReason; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? _migrationStatus; + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? MigrationStatus { get => this._migrationStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName _targetSkuName; + + /// Target sku name for the account + [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 StorageAccountMigrationProperties() + { + + } + } + /// The properties of a storage account’s ongoing or enqueued migration. + public partial interface IStorageAccountMigrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Reason for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reason for migration failure", + SerializedName = @"migrationFailedDetailedReason", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailedDetailedReason { get; } + /// Error code for migration failure + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code for migration failure", + SerializedName = @"migrationFailedReason", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailedReason { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? MigrationStatus { get; } + /// Target sku name for the account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target sku name for the account", + SerializedName = @"targetSkuName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName TargetSkuName { get; set; } + + } + /// The properties of a storage account’s ongoing or enqueued migration. + internal partial interface IStorageAccountMigrationPropertiesInternal + + { + /// Reason for migration failure + string MigrationFailedDetailedReason { get; set; } + /// Error code for migration failure + string MigrationFailedReason { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus? MigrationStatus { get; set; } + /// Target sku name for the account + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName TargetSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.json.cs new file mode 100644 index 000000000000..22e3fc5e68a6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountMigrationProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s ongoing or enqueued migration. + public partial class StorageAccountMigrationProperties + { + + /// + /// 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.Api20230501.IStorageAccountMigrationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigrationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountMigrationProperties(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 StorageAccountMigrationProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetSkuName = If( json?.PropertyT("targetSkuName"), out var __jsonTargetSkuName) ? (string)__jsonTargetSkuName : (string)TargetSkuName;} + {_migrationStatus = If( json?.PropertyT("migrationStatus"), out var __jsonMigrationStatus) ? (string)__jsonMigrationStatus : (string)MigrationStatus;} + {_migrationFailedReason = If( json?.PropertyT("migrationFailedReason"), out var __jsonMigrationFailedReason) ? (string)__jsonMigrationFailedReason : (string)MigrationFailedReason;} + {_migrationFailedDetailedReason = If( json?.PropertyT("migrationFailedDetailedReason"), out var __jsonMigrationFailedDetailedReason) ? (string)__jsonMigrationFailedDetailedReason : (string)MigrationFailedDetailedReason;} + 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._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._migrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._migrationStatus.ToString()) : null, "migrationStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationFailedReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._migrationFailedReason.ToString()) : null, "migrationFailedReason" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationFailedDetailedReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._migrationFailedDetailedReason.ToString()) : null, "migrationFailedDetailedReason" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.PowerShell.cs new file mode 100644 index 000000000000..4f70b7762926 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.PowerShell.cs @@ -0,0 +1,1128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus) content.GetValueForProperty("BlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("StorageAccountSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("IsSkuConversionBlocked")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSkuConversionBlocked = (bool?) content.GetValueForProperty("IsSkuConversionBlocked",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSkuConversionBlocked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AccountMigrationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccountMigrationInProgress = (bool?) content.GetValueForProperty("AccountMigrationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccountMigrationInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatCanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanPlannedFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatPostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("GeoReplicationStatPostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("BlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StorageAccountSkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("StorageAccountSkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("StorageAccountSkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("StorageAccountSkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus) content.GetValueForProperty("BlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("StorageAccountSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("IsSkuConversionBlocked")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSkuConversionBlocked = (bool?) content.GetValueForProperty("IsSkuConversionBlocked",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).IsSkuConversionBlocked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AccountMigrationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccountMigrationInProgress = (bool?) content.GetValueForProperty("AccountMigrationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AccountMigrationInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatCanPlannedFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanPlannedFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanPlannedFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanPlannedFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GeoReplicationStatPostFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy.CreateFrom); + } + if (content.Contains("GeoReplicationStatPostPlannedFailoverRedundancy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy?) content.GetValueForProperty("GeoReplicationStatPostPlannedFailoverRedundancy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).GeoReplicationStatPostPlannedFailoverRedundancy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("BlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StorageAccountSkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("StorageAccountSkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("StorageAccountSkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("StorageAccountSkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.TypeConverter.cs new file mode 100644 index 000000000000..418978d960be --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.cs new file mode 100644 index 000000000000..061f6c445dee --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.cs @@ -0,0 +1,2283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage account. + public partial class StorageAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + + /// Backing field for property. + private bool? _accountMigrationInProgress; + + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AccountMigrationInProgress { get => this._accountMigrationInProgress; } + + /// 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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatus BlobRestoreStatus { get => (this._blobRestoreStatus = this._blobRestoreStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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? _enableExtendedGroup; + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableExtendedGroup { get => this._enableExtendedGroup; set => this._enableExtendedGroup = 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.Api20230501.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.Api20230501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IGeoReplicationStats GeoReplicationStat { get => (this._geoReplicationStat = this._geoReplicationStat ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover; } + + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? GeoReplicationStatCanPlannedFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanPlannedFailover; } + + /// + /// 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.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime; } + + /// The redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostFailoverRedundancy; } + + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostPlannedFailoverRedundancy; } + + /// + /// 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.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 bool? _isSkuConversionBlocked; + + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsSkuConversionBlocked { get => this._isSkuConversionBlocked; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTime KeyCreationTime { get => (this._keyCreationTime = this._keyCreationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTimeInternal)KeyCreationTime).Key1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyCreationTimeInternal)KeyCreationTime).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTimeInternal)KeyCreationTime).Key2 = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal.AccessTier { get => this._accessTier; set { {_accessTier = value;} } } + + /// Internal Acessors for AccountMigrationInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.AccountMigrationInProgress { get => this._accountMigrationInProgress; set { {_accountMigrationInProgress = value;} } } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for BlobRestoreStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.BlobRestoreStatus { get => (this._blobRestoreStatus = this._blobRestoreStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatus()); set { {_blobRestoreStatus = value;} } } + + /// Internal Acessors for BlobRestoreStatusFailureReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).FailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).FailureReason = value; } + + /// Internal Acessors for BlobRestoreStatusParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.BlobRestoreStatusParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).Parameter = value; } + + /// Internal Acessors for BlobRestoreStatusRestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).RestoreId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).RestoreId = value; } + + /// Internal Acessors for BlobRestoreStatusStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.BlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).Status = value; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Encryption()); set { {_encryption = value;} } } + + /// Internal Acessors for FailoverInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.FailoverInProgress { get => this._failoverInProgress; set { {_failoverInProgress = value;} } } + + /// Internal Acessors for GeoReplicationStat + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStats Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStat { get => (this._geoReplicationStat = this._geoReplicationStat ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStats()); set { {_geoReplicationStat = value;} } } + + /// Internal Acessors for GeoReplicationStatCanFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover = value; } + + /// Internal Acessors for GeoReplicationStatCanPlannedFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatCanPlannedFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanPlannedFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).CanPlannedFailover = value; } + + /// Internal Acessors for GeoReplicationStatLastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime = value; } + + /// Internal Acessors for GeoReplicationStatPostFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatPostFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostFailoverRedundancy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostFailoverRedundancy = value; } + + /// Internal Acessors for GeoReplicationStatPostPlannedFailoverRedundancy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatPostPlannedFailoverRedundancy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostPlannedFailoverRedundancy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).PostPlannedFailoverRedundancy = value; } + + /// Internal Acessors for GeoReplicationStatStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IGeoReplicationStatsInternal)GeoReplicationStat).Status = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for IsSkuConversionBlocked + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.IsSkuConversionBlocked { get => this._isSkuConversionBlocked; set { {_isSkuConversionBlocked = value;} } } + + /// Internal Acessors for KeyCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.KeyCreationTime { get => (this._keyCreationTime = this._keyCreationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTime()); set { {_keyCreationTime = value;} } } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for LastGeoFailoverTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.LastGeoFailoverTime { get => this._lastGeoFailoverTime; set { {_lastGeoFailoverTime = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for PrimaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpoint { get => (this._primaryEndpoint = this._primaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Endpoints()); set { {_primaryEndpoint = value;} } } + + /// Internal Acessors for PrimaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Blob = value; } + + /// Internal Acessors for PrimaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Df = value; } + + /// Internal Acessors for PrimaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).File = value; } + + /// Internal Acessors for PrimaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Queue = value; } + + /// Internal Acessors for PrimaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Table = value; } + + /// Internal Acessors for PrimaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).Web = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointWeb = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointQueue = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointTable = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointWeb = value; } + + /// Internal Acessors for PrimaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.PrimaryLocation { get => this._primaryLocation; set { {_primaryLocation = value;} } } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); set { {_sasPolicy = value;} } } + + /// Internal Acessors for SecondaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpoint { get => (this._secondaryEndpoint = this._secondaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Endpoints()); set { {_secondaryEndpoint = value;} } } + + /// Internal Acessors for SecondaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Blob = value; } + + /// Internal Acessors for SecondaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Df = value; } + + /// Internal Acessors for SecondaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).File = value; } + + /// Internal Acessors for SecondaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Queue = value; } + + /// Internal Acessors for SecondaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Table = value; } + + /// Internal Acessors for SecondaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).Web = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointWeb = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointQueue = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointTable = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointWeb = value; } + + /// Internal Acessors for SecondaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesInternal.StatusOfSecondary { get => this._statusOfSecondary; set { {_statusOfSecondary = value;} } } + + /// Internal Acessors for StorageAccountSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatus { get => (this._storageAccountSkuConversionStatus = this._storageAccountSkuConversionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountSkuConversionStatus()); set { {_storageAccountSkuConversionStatus = value;} } } + + /// Internal Acessors for StorageAccountSkuConversionStatusEndTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).EndTime = value; } + + /// Internal Acessors for StorageAccountSkuConversionStatusSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).SkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).SkuConversionStatus = value; } + + /// Internal Acessors for StorageAccountSkuConversionStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterBlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterTimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterTimeToRestore = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEndpoints PrimaryEndpoint { get => (this._primaryEndpoint = this._primaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + [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.Api20230501.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.Api20230501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEndpoints SecondaryEndpoint { get => (this._secondaryEndpoint = this._secondaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountSkuConversionStatus StorageAccountSkuConversionStatus { get => (this._storageAccountSkuConversionStatus = this._storageAccountSkuConversionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).TargetSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If customer initiated account migration is in progress, the value will be true else it will be null.", + SerializedName = @"accountMigrationInProgress", + PossibleTypes = new [] { typeof(bool) })] + bool? AccountMigrationInProgress { 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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + /// + /// A boolean flag which indicates whether or not planned 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 planned account failover is supported for the account.", + SerializedName = @"canPlannedFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? GeoReplicationStatCanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after an account failover is performed.", + SerializedName = @"postFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The redundancy type of the account after a planned account failover is performed.", + SerializedName = @"postPlannedFailoverRedundancy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { 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; } + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property will be set to true or false on an event of ongoing migration. Default value is null.", + SerializedName = @"isSkuConversionBlocked", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSkuConversionBlocked { get; } + + [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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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; } + /// + /// If customer initiated account migration is in progress, the value will be true else it will be null. + /// + bool? AccountMigrationInProgress { 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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// Blob restore status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.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.Api20230501.IGeoReplicationStats GeoReplicationStat { get; set; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + bool? GeoReplicationStatCanFailover { get; set; } + /// + /// A boolean flag which indicates whether or not planned account failover is supported for the account. + /// + bool? GeoReplicationStatCanPlannedFailover { 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 redundancy type of the account after an account failover is performed. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy? GeoReplicationStatPostFailoverRedundancy { get; set; } + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy? GeoReplicationStatPostPlannedFailoverRedundancy { 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.Api20230501.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.Api20230501.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; } + /// + /// This property will be set to true or false on an event of ongoing migration. Default value is null. + /// + bool? IsSkuConversionBlocked { get; set; } + /// Storage account keys creation time. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountInternetEndpoints PrimaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.Api20230501.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.Api20230501.IStorageAccountInternetEndpoints SecondaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.json.cs new file mode 100644 index 000000000000..9ab4e19bd921 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountProperties.json.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IStorageAccountProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.Endpoints.FromJson(__jsonPrimaryEndpoints) : PrimaryEndpoint;} + {_customDomain = If( json?.PropertyT("customDomain"), out var __jsonCustomDomain) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_sasPolicy = If( json?.PropertyT("sasPolicy"), out var __jsonSasPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_keyCreationTime = If( json?.PropertyT("keyCreationTime"), out var __jsonKeyCreationTime) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyCreationTime.FromJson(__jsonKeyCreationTime) : KeyCreationTime;} + {_secondaryEndpoint = If( json?.PropertyT("secondaryEndpoints"), out var __jsonSecondaryEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Endpoints.FromJson(__jsonSecondaryEndpoints) : SecondaryEndpoint;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_geoReplicationStat = If( json?.PropertyT("geoReplicationStats"), out var __jsonGeoReplicationStats) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.GeoReplicationStats.FromJson(__jsonGeoReplicationStats) : GeoReplicationStat;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_blobRestoreStatus = If( json?.PropertyT("blobRestoreStatus"), out var __jsonBlobRestoreStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.BlobRestoreStatus.FromJson(__jsonBlobRestoreStatus) : BlobRestoreStatus;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount.FromJson(__jsonImmutableStorageWithVersioning) : ImmutableStorageWithVersioning;} + {_storageAccountSkuConversionStatus = If( json?.PropertyT("storageAccountSkuConversionStatus"), out var __jsonStorageAccountSkuConversionStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_enableExtendedGroup = If( json?.PropertyT("enableExtendedGroups"), out var __jsonEnableExtendedGroups) ? (bool?)__jsonEnableExtendedGroups : EnableExtendedGroup;} + {_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.Api20230501.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_isSkuConversionBlocked = If( json?.PropertyT("isSkuConversionBlocked"), out var __jsonIsSkuConversionBlocked) ? (bool?)__jsonIsSkuConversionBlocked : IsSkuConversionBlocked;} + {_accountMigrationInProgress = If( json?.PropertyT("accountMigrationInProgress"), out var __jsonAccountMigrationInProgress) ? (bool?)__jsonAccountMigrationInProgress : AccountMigrationInProgress;} + {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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._enableExtendedGroup ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableExtendedGroup) : null, "enableExtendedGroups" ,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._isSkuConversionBlocked ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isSkuConversionBlocked) : null, "isSkuConversionBlocked" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._accountMigrationInProgress ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._accountMigrationInProgress) : null, "accountMigrationInProgress" ,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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.PowerShell.cs new file mode 100644 index 000000000000..59af3c63876d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.PowerShell.cs @@ -0,0 +1,565 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.TypeConverter.cs new file mode 100644 index 000000000000..efdbea7d1c4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesCreateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.cs new file mode 100644 index 000000000000..de86624b3fd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.cs @@ -0,0 +1,1025 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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? _enableExtendedGroup; + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableExtendedGroup { get => this._enableExtendedGroup; set => this._enableExtendedGroup = 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.Api20230501.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.Api20230501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParametersInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); set { {_sasPolicy = 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.Api20230501.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.Api20230501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [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.Api20230501.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.Api20230501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); set => this._sasPolicy = value; } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.json.cs new file mode 100644 index 000000000000..91c5db9c2f21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesCreateParameters.json.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.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_customDomain = If( json?.PropertyT("customDomain"), out var __jsonCustomDomain) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_enableExtendedGroup = If( json?.PropertyT("enableExtendedGroups"), out var __jsonEnableExtendedGroups) ? (bool?)__jsonEnableExtendedGroups : EnableExtendedGroup;} + {_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.Api20230501.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._enableExtendedGroup ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableExtendedGroup) : null, "enableExtendedGroups" ,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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..666364cb3231 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.PowerShell.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..66ad3fc0d1ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.cs new file mode 100644 index 000000000000..ffb9da2858dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.cs @@ -0,0 +1,987 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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? _enableExtendedGroup; + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableExtendedGroup { get => this._enableExtendedGroup; set => this._enableExtendedGroup = 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.Api20230501.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.Api20230501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); set { {_sasPolicy = 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.Api20230501.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.Api20230501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [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.Api20230501.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.Api20230501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy()); set => this._sasPolicy = value; } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicyInternal)SasPolicy).ExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.json.cs new file mode 100644 index 000000000000..93b8b467bb91 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountPropertiesUpdateParameters.json.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.Api20230501 +{ + 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.Api20230501.IStorageAccountPropertiesUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_sasPolicy = If( json?.PropertyT("sasPolicy"), out var __jsonSasPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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;} + {_enableExtendedGroup = If( json?.PropertyT("enableExtendedGroups"), out var __jsonEnableExtendedGroups) ? (bool?)__jsonEnableExtendedGroups : EnableExtendedGroup;} + {_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.Api20230501.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 != this._enableExtendedGroup ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableExtendedGroup) : null, "enableExtendedGroups" ,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.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.PowerShell.cs new file mode 100644 index 000000000000..b07fafa9aaef --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.TypeConverter.cs new file mode 100644 index 000000000000..c775bd2ffa25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountRegenerateKeyParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.cs new file mode 100644 index 000000000000..eac1a3199d4e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountRegenerateKeyParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountRegenerateKeyParameters.json.cs new file mode 100644 index 000000000000..35073fee0c4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountRegenerateKeyParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountRegenerateKeyParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.PowerShell.cs new file mode 100644 index 000000000000..5b17ab12850d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatusInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.TypeConverter.cs new file mode 100644 index 000000000000..0b940ca19ea7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountSkuConversionStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.cs new file mode 100644 index 000000000000..7379d6df67e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountSkuConversionStatus, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountSkuConversionStatusInternal.SkuConversionStatus { get => this._skuConversionStatus; set { {_skuConversionStatus = value;} } } + + /// Internal Acessors for StartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountSkuConversionStatus.json.cs new file mode 100644 index 000000000000..839be649d843 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountSkuConversionStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountSkuConversionStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..57b8772c44ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.PowerShell.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageAccountUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableExtendedGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableExtendedGroup = (bool?) content.GetValueForProperty("EnableExtendedGroup",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).EnableExtendedGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction.CreateFrom); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..57b91988f94f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.cs new file mode 100644 index 000000000000..55c44a0c6832 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.cs @@ -0,0 +1,1084 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false + /// 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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableExtendedGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).EnableExtendedGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).EnableExtendedGroup = value ?? default(bool); } + + /// 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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).Encryption = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).LargeFileSharesState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomain = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParameters()); set { {_property = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicy = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParameters()); set => this._property = value; } + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicyExpirationAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.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.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicySasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInternal)Sku).Tier; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageAccountUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 false for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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; } + /// Enables extended group support with local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableExtendedGroup { 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.Api20230501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? SasPolicyExpirationAction { get; set; } + /// 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.Api20230501.IStorageAccountUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + 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.Api20230501.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.Api20230501.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.Api20230501.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; } + /// Enables extended group support with local users feature, if set to true + bool? EnableExtendedGroup { 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.Api20230501.IEncryption Encryption { get; set; } + /// The identity of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// The parameters used when updating a storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountPropertiesUpdateParameters Property { get; set; } + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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.Api20230501.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.Api20230501.ISasPolicy SasPolicy { get; set; } + /// + /// The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction? 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.Api20230501.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.Api20230501.IStorageAccountUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParameters.json.cs new file mode 100644 index 000000000000..643bee2879b3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.Sku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Identity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountPropertiesUpdateParameters.FromJson(__jsonProperties) : Property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..7449ecf1bfb5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..34f06ae21c9a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.cs new file mode 100644 index 000000000000..d749ed3db939 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.dictionary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..04e871632f9a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.StorageAccountUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageAccountUpdateParametersTags.json.cs new file mode 100644 index 000000000000..b241fa831cfa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageAccountUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageQueue.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageQueue.PowerShell.cs new file mode 100644 index 000000000000..f561952e7502 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("QueuePropertyApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount = (int?) content.GetValueForProperty("QueuePropertyApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("QueuePropertyApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount = (int?) content.GetValueForProperty("QueuePropertyApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageQueue.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageQueue.TypeConverter.cs new file mode 100644 index 000000000000..1c96d7a2d4dc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageQueue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageQueue.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageQueue.cs new file mode 100644 index 000000000000..01f7ca7ae48a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueue, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueueProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal.QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.QueueProperties()); set { {_queueProperty = value;} } } + + /// Internal Acessors for QueuePropertyApproximateMessageCount + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueueInternal.QueuePropertyApproximateMessageCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)QueueProperty).ApproximateMessageCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueueProperties QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueuePropertiesMetadata QueuePropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IQueuePropertiesInternal)QueueProperty).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageQueue.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageQueue.json.cs new file mode 100644 index 000000000000..9577c6c47edd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageQueue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageQueue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.PowerShell.cs new file mode 100644 index 000000000000..246c673b19d8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IStorageSkuListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageSkuListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IStorageSkuListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageSkuListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.TypeConverter.cs new file mode 100644 index 000000000000..c5df9a2000d4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageSkuListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.cs new file mode 100644 index 000000000000..48d069bdb679 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageSkuListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageSkuListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ISkuInformation[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageSkuListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ISkuInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInformation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageSkuListResult.json.cs new file mode 100644 index 000000000000..e0beb40dfe8d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IStorageSkuListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageSkuListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISkuInformation) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.PowerShell.cs new file mode 100644 index 000000000000..0c52b657775f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentTypeConverter))] + public partial class StorageTaskAssignment + { + + /// + /// 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.Api20230501.IStorageTaskAssignment DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignment(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.Api20230501.IStorageTaskAssignment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignment(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.Api20230501.IStorageTaskAssignment 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 StorageTaskAssignment(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.Api20230501.IStorageTaskAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentPropertiesTypeConverter.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("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartOn, (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 StorageTaskAssignment(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.Api20230501.IStorageTaskAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentPropertiesTypeConverter.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("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal)this).ParameterStartOn, (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 storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentTypeConverter))] + public partial interface IStorageTaskAssignment + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.TypeConverter.cs new file mode 100644 index 000000000000..3ab61dad80d0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentTypeConverter : 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.Api20230501.IStorageTaskAssignment ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignment.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignment.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignment.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.cs new file mode 100644 index 000000000000..9153f1c8c436 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.cs @@ -0,0 +1,680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment. + public partial class StorageTaskAssignment : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal, + 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(); + + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Description = value ; } + + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Enabled = 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 ExecutionContext + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.ExecutionContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContext = value; } + + /// Internal Acessors for ExecutionContextTarget + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.ExecutionContextTarget { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContextTarget; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContextTarget = value; } + + /// Internal Acessors for ExecutionContextTrigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.ExecutionContextTrigger { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContextTrigger; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ExecutionContextTrigger = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.Report { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Report; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).Report = value; } + + /// Internal Acessors for RunStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatus = value; } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusEnum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusEnum = value; } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusError = value; } + + /// Internal Acessors for RunStatusFinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusFinishTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusFinishTime = value; } + + /// Internal Acessors for RunStatusObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectFailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectFailedCount = value; } + + /// Internal Acessors for RunStatusObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsOperatedOnCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsOperatedOnCount = value; } + + /// Internal Acessors for RunStatusObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsSucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsSucceededCount = value; } + + /// Internal Acessors for RunStatusObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsTargetedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsTargetedCount = value; } + + /// Internal Acessors for RunStatusRunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusRunResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusRunResult = value; } + + /// Internal Acessors for RunStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStartTime = value; } + + /// Internal Acessors for RunStatusStorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStorageAccountId = value; } + + /// Internal Acessors for RunStatusSummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusSummaryReportPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusSummaryReportPath = value; } + + /// Internal Acessors for RunStatusTaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskAssignmentId = value; } + + /// Internal Acessors for RunStatusTaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskId = value; } + + /// Internal Acessors for RunStatusTaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskVersion = value; } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TriggerParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TriggerParameter = 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; } + + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties _property; + + /// Properties of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentProperties()); set => this._property = value; } + + /// Represents the provisioning state of the storage task assignment. + [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.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ProvisioningState; } + + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ReportPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ReportPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).ReportPrefix = value ; } + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusEnum; } + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusError; } + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusFinishTime; } + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectFailedCount; } + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsOperatedOnCount; } + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsSucceededCount; } + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusObjectsTargetedCount; } + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusRunResult; } + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStartTime; } + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusStorageAccountId; } + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusSummaryReportPath; } + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskAssignmentId; } + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskId; } + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).RunStatusTaskVersion; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TargetExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TargetExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TargetPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TargetPrefix = value ?? null /* arrayOf */; } + + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string TaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TaskId = value ; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TriggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)Property).TriggerType = 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 StorageTaskAssignment() + { + + } + + /// 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 task assignment. + public partial interface IStorageTaskAssignment : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the provisioning state of the storage task assignment.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container prefix for the location of storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string ReportPrefix { get; set; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusFinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string RunStatusSummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskVersion { get; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the corresponding storage task", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } + /// The storage task assignment. + internal partial interface IStorageTaskAssignmentInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Text that describes the purpose of the storage task assignment + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + bool Enabled { get; set; } + /// The storage task assignment execution context + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext ExecutionContext { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget ExecutionContextTarget { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger ExecutionContextTrigger { get; set; } + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Properties of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties Property { get; set; } + /// Represents the provisioning state of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// The storage task assignment report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport Report { get; set; } + /// The container prefix for the location of storage task assignment report + string ReportPrefix { get; set; } + /// Run status of storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusFinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsTargetedCount { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusStartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string RunStatusStorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string RunStatusSummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string RunStatusTaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string RunStatusTaskId { get; set; } + /// Storage Task Version + string RunStatusTaskVersion { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + string TaskId { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.json.cs new file mode 100644 index 000000000000..0aa23913b2b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignment.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment. + public partial class StorageTaskAssignment + { + + /// + /// 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.Api20230501.IStorageTaskAssignment. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignment(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 StorageTaskAssignment(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.Api20230501.StorageTaskAssignmentProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.PowerShell.cs new file mode 100644 index 000000000000..2f3e36da2078 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Execution context of the storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentExecutionContextTypeConverter))] + public partial class StorageTaskAssignmentExecutionContext + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentExecutionContext DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentExecutionContext(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.Api20230501.IStorageTaskAssignmentExecutionContext DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentExecutionContext(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.Api20230501.IStorageTaskAssignmentExecutionContext 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 StorageTaskAssignmentExecutionContext(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Trigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Trigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("Trigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Trigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartOn, (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 StorageTaskAssignmentExecutionContext(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Trigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Trigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("Trigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).Trigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)this).ParameterStartOn, (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(); + } + /// Execution context of the storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentExecutionContextTypeConverter))] + public partial interface IStorageTaskAssignmentExecutionContext + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.TypeConverter.cs new file mode 100644 index 000000000000..c907aab41051 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentExecutionContextTypeConverter : 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.Api20230501.IStorageTaskAssignmentExecutionContext ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentExecutionContext.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentExecutionContext.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentExecutionContext.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.cs new file mode 100644 index 000000000000..9d82d2d99f3f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution context of the storage task assignment. + public partial class StorageTaskAssignmentExecutionContext : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal + { + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget()); set { {_target = value;} } } + + /// Internal Acessors for Trigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal.Trigger { get => (this._trigger = this._trigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTrigger()); set { {_trigger = value;} } } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).Parameter = value; } + + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget _target; + + /// Execution target of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget()); set => this._target = value; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).ExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).ExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).Prefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).Prefix = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger _trigger; + + /// Execution trigger of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger Trigger { get => (this._trigger = this._trigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTrigger()); set => this._trigger = value; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerInternal)Trigger).Type = value ; } + + /// Creates an new instance. + public StorageTaskAssignmentExecutionContext() + { + + } + } + /// Execution context of the storage task assignment. + public partial interface IStorageTaskAssignmentExecutionContext : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } + /// Execution context of the storage task assignment. + internal partial interface IStorageTaskAssignmentExecutionContextInternal + + { + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Target { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger Trigger { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.json.cs new file mode 100644 index 000000000000..1b0c643d6210 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentExecutionContext.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution context of the storage task assignment. + public partial class StorageTaskAssignmentExecutionContext + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentExecutionContext. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentExecutionContext(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 StorageTaskAssignmentExecutionContext(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget.FromJson(__jsonTarget) : Target;} + {_trigger = If( json?.PropertyT("trigger"), out var __jsonTrigger) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTrigger.FromJson(__jsonTrigger) : Trigger;} + 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._target ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._target.ToJson(null,serializationMode) : null, "target" ,container.Add ); + AddIf( null != this._trigger ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._trigger.ToJson(null,serializationMode) : null, "trigger" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.PowerShell.cs new file mode 100644 index 000000000000..22ac2ff22a96 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.PowerShell.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentPropertiesTypeConverter))] + public partial class StorageTaskAssignmentProperties + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentProperties(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.Api20230501.IStorageTaskAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentProperties(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.Api20230501.IStorageTaskAssignmentProperties 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 StorageTaskAssignmentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartOn, (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 StorageTaskAssignmentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal)this).ParameterStartOn, (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 the storage task assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentPropertiesTypeConverter))] + public partial interface IStorageTaskAssignmentProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.TypeConverter.cs new file mode 100644 index 000000000000..4beada16cf89 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentPropertiesTypeConverter : 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.Api20230501.IStorageTaskAssignmentProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.cs new file mode 100644 index 000000000000..8a71800ae965 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.cs @@ -0,0 +1,658 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage task assignment. + public partial class StorageTaskAssignmentProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Text that describes the purpose of the storage task assignment + [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 bool _enabled; + + /// Whether the storage task assignment is enabled or not + [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.Api20230501.IStorageTaskAssignmentExecutionContext _executionContext; + + /// The storage task assignment execution context + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext ExecutionContext { get => (this._executionContext = this._executionContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContext()); set => this._executionContext = value; } + + /// Internal Acessors for ExecutionContext + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.ExecutionContext { get => (this._executionContext = this._executionContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContext()); set { {_executionContext = value;} } } + + /// Internal Acessors for ExecutionContextTarget + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.ExecutionContextTarget { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).Target = value; } + + /// Internal Acessors for ExecutionContextTrigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.ExecutionContextTrigger { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).Trigger; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).Trigger = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.Report { get => (this._report = this._report ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReport()); set { {_report = value;} } } + + /// Internal Acessors for RunStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatus { get => (this._runStatus = this._runStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set { {_runStatus = value;} } } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum = value; } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError = value; } + + /// Internal Acessors for RunStatusFinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime = value; } + + /// Internal Acessors for RunStatusObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount = value; } + + /// Internal Acessors for RunStatusObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount = value; } + + /// Internal Acessors for RunStatusObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount = value; } + + /// Internal Acessors for RunStatusObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount = value; } + + /// Internal Acessors for RunStatusRunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult = value; } + + /// Internal Acessors for RunStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime = value; } + + /// Internal Acessors for RunStatusStorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId = value; } + + /// Internal Acessors for RunStatusSummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath = value; } + + /// Internal Acessors for RunStatusTaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId = value; } + + /// Internal Acessors for RunStatusTaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId = value; } + + /// Internal Acessors for RunStatusTaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion = value; } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentPropertiesInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TriggerParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TriggerParameter = value; } + + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? _provisioningState; + + /// Represents the provisioning state of the storage task assignment. + [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.Models.Api20230501.IStorageTaskAssignmentReport _report; + + /// The storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport Report { get => (this._report = this._report ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReport()); set => this._report = value; } + + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ReportPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)Report).Prefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)Report).Prefix = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties _runStatus; + + /// Run status of storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get => (this._runStatus = this._runStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set => this._runStatus = value; } + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum; } + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError; } + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime; } + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount; } + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount; } + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount; } + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount; } + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult; } + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime; } + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId; } + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath; } + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId; } + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId; } + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TargetExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TargetExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TargetPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TargetPrefix = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _taskId; + + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TriggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContextInternal)ExecutionContext).TriggerType = value ; } + + /// Creates an new instance. + public StorageTaskAssignmentProperties() + { + + } + } + /// Properties of the storage task assignment. + public partial interface IStorageTaskAssignmentProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the provisioning state of the storage task assignment.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container prefix for the location of storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string ReportPrefix { get; set; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusFinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string RunStatusSummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskVersion { get; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the corresponding storage task", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } + /// Properties of the storage task assignment. + internal partial interface IStorageTaskAssignmentPropertiesInternal + + { + /// Text that describes the purpose of the storage task assignment + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + bool Enabled { get; set; } + /// The storage task assignment execution context + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentExecutionContext ExecutionContext { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget ExecutionContextTarget { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTrigger ExecutionContextTrigger { get; set; } + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// The storage task assignment report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport Report { get; set; } + /// The container prefix for the location of storage task assignment report + string ReportPrefix { get; set; } + /// Run status of storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusFinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsTargetedCount { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusStartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string RunStatusStorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string RunStatusSummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string RunStatusTaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string RunStatusTaskId { get; set; } + /// Storage Task Version + string RunStatusTaskVersion { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + string TaskId { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.json.cs new file mode 100644 index 000000000000..23ab9d6402d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage task assignment. + public partial class StorageTaskAssignmentProperties + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentProperties(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 StorageTaskAssignmentProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_executionContext = If( json?.PropertyT("executionContext"), out var __jsonExecutionContext) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentExecutionContext.FromJson(__jsonExecutionContext) : ExecutionContext;} + {_report = If( json?.PropertyT("report"), out var __jsonReport) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentReport.FromJson(__jsonReport) : Report;} + {_runStatus = If( json?.PropertyT("runStatus"), out var __jsonRunStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties.FromJson(__jsonRunStatus) : RunStatus;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_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._executionContext ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._executionContext.ToJson(null,serializationMode) : null, "executionContext" ,container.Add ); + AddIf( null != this._report ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._report.ToJson(null,serializationMode) : null, "report" ,container.Add ); + AddIf( null != this._runStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._runStatus.ToJson(null,serializationMode) : null, "runStatus" ,container.Add ); + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,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._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 ); + 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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.PowerShell.cs new file mode 100644 index 000000000000..8545caf6a08f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage task assignment report + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentReportTypeConverter))] + public partial class StorageTaskAssignmentReport + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentReport DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentReport(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.Api20230501.IStorageTaskAssignmentReport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentReport(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.Api20230501.IStorageTaskAssignmentReport 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 StorageTaskAssignmentReport(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)this).Prefix = (string) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)this).Prefix, 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 StorageTaskAssignmentReport(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)this).Prefix = (string) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal)this).Prefix, 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 task assignment report + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentReportTypeConverter))] + public partial interface IStorageTaskAssignmentReport + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.TypeConverter.cs new file mode 100644 index 000000000000..71859dca1ffa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentReportTypeConverter : 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.Api20230501.IStorageTaskAssignmentReport ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentReport.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentReport.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentReport.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.cs new file mode 100644 index 000000000000..0e33e39f871a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment report + public partial class StorageTaskAssignmentReport : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReportInternal + { + + /// Backing field for property. + private string _prefix; + + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Prefix { get => this._prefix; set => this._prefix = value; } + + /// Creates an new instance. + public StorageTaskAssignmentReport() + { + + } + } + /// The storage task assignment report + public partial interface IStorageTaskAssignmentReport : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The container prefix for the location of storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container prefix for the location of storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string Prefix { get; set; } + + } + /// The storage task assignment report + internal partial interface IStorageTaskAssignmentReportInternal + + { + /// The container prefix for the location of storage task assignment report + string Prefix { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.json.cs new file mode 100644 index 000000000000..861d36edf117 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentReport.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment report + public partial class StorageTaskAssignmentReport + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentReport. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentReport FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentReport(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 StorageTaskAssignmentReport(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefix = If( json?.PropertyT("prefix"), out var __jsonPrefix) ? (string)__jsonPrefix : (string)Prefix;} + 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._prefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._prefix.ToString()) : null, "prefix" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.PowerShell.cs new file mode 100644 index 000000000000..e17e9fca1881 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Execution context of the storage task assignment update. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateExecutionContextTypeConverter))] + public partial class StorageTaskAssignmentUpdateExecutionContext + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentUpdateExecutionContext(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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentUpdateExecutionContext(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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext 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 StorageTaskAssignmentUpdateExecutionContext(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Trigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Trigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("Trigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Trigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartOn, (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 StorageTaskAssignmentUpdateExecutionContext(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Trigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Trigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("Trigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).Trigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)this).ParameterStartOn, (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(); + } + /// Execution context of the storage task assignment update. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateExecutionContextTypeConverter))] + public partial interface IStorageTaskAssignmentUpdateExecutionContext + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.TypeConverter.cs new file mode 100644 index 000000000000..ff3e9b7b405c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentUpdateExecutionContextTypeConverter : 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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentUpdateExecutionContext.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateExecutionContext.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateExecutionContext.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.cs new file mode 100644 index 000000000000..082be018a565 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution context of the storage task assignment update. + public partial class StorageTaskAssignmentUpdateExecutionContext : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal + { + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget()); set { {_target = value;} } } + + /// Internal Acessors for Trigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal.Trigger { get => (this._trigger = this._trigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdate()); set { {_trigger = value;} } } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).Parameter = value; } + + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget _target; + + /// Execution target of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget()); set => this._target = value; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).ExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).ExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).Prefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTargetInternal)Target).Prefix = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate _trigger; + + /// Execution trigger of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate Trigger { get => (this._trigger = this._trigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdate()); set => this._trigger = value; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdateInternal)Trigger).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType)""); } + + /// + /// Creates an new instance. + /// + public StorageTaskAssignmentUpdateExecutionContext() + { + + } + } + /// Execution context of the storage task assignment update. + public partial interface IStorageTaskAssignmentUpdateExecutionContext : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } + /// Execution context of the storage task assignment update. + internal partial interface IStorageTaskAssignmentUpdateExecutionContextInternal + + { + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Target { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate Trigger { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.json.cs new file mode 100644 index 000000000000..4b58c8ab407b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateExecutionContext.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Execution context of the storage task assignment update. + public partial class StorageTaskAssignmentUpdateExecutionContext + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentUpdateExecutionContext(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 StorageTaskAssignmentUpdateExecutionContext(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTarget.FromJson(__jsonTarget) : Target;} + {_trigger = If( json?.PropertyT("trigger"), out var __jsonTrigger) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdate.FromJson(__jsonTrigger) : Trigger;} + 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._target ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._target.ToJson(null,serializationMode) : null, "target" ,container.Add ); + AddIf( null != this._trigger ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._trigger.ToJson(null,serializationMode) : null, "trigger" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..6c4011987d47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.PowerShell.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Parameters of the storage task assignment update request + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateParametersTypeConverter))] + public partial class StorageTaskAssignmentUpdateParameters + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentUpdateParameters(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.Api20230501.IStorageTaskAssignmentUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentUpdateParameters(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.Api20230501.IStorageTaskAssignmentUpdateParameters 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 StorageTaskAssignmentUpdateParameters(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.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartOn, (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 StorageTaskAssignmentUpdateParameters(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.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal)this).ParameterStartOn, (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(); + } + /// Parameters of the storage task assignment update request + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateParametersTypeConverter))] + public partial interface IStorageTaskAssignmentUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..df70c840270f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentUpdateParametersTypeConverter : 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.Api20230501.IStorageTaskAssignmentUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateParameters.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.cs new file mode 100644 index 000000000000..3b94cd3d1690 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.cs @@ -0,0 +1,640 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Parameters of the storage task assignment update request + public partial class StorageTaskAssignmentUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal + { + + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Description = value ?? null; } + + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// Internal Acessors for ExecutionContext + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.ExecutionContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContext = value; } + + /// Internal Acessors for ExecutionContextTarget + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.ExecutionContextTarget { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContextTarget; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContextTarget = value; } + + /// Internal Acessors for ExecutionContextTrigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.ExecutionContextTrigger { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContextTrigger; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ExecutionContextTrigger = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.Report { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Report; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).Report = value; } + + /// Internal Acessors for RunStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatus = value; } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusEnum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusEnum = value; } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusError = value; } + + /// Internal Acessors for RunStatusFinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusFinishTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusFinishTime = value; } + + /// Internal Acessors for RunStatusObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectFailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectFailedCount = value; } + + /// Internal Acessors for RunStatusObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsOperatedOnCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsOperatedOnCount = value; } + + /// Internal Acessors for RunStatusObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsSucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsSucceededCount = value; } + + /// Internal Acessors for RunStatusObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsTargetedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsTargetedCount = value; } + + /// Internal Acessors for RunStatusRunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusRunResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusRunResult = value; } + + /// Internal Acessors for RunStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStartTime = value; } + + /// Internal Acessors for RunStatusStorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStorageAccountId = value; } + + /// Internal Acessors for RunStatusSummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusSummaryReportPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusSummaryReportPath = value; } + + /// Internal Acessors for RunStatusTaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskAssignmentId = value; } + + /// Internal Acessors for RunStatusTaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskId = value; } + + /// Internal Acessors for RunStatusTaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskVersion = value; } + + /// Internal Acessors for TaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.TaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TaskId = value; } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParametersInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TriggerParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TriggerParameter = value; } + + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties _property; + + /// Properties of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateProperties()); set => this._property = value; } + + /// Represents the provisioning state of the storage task assignment. + [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.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ProvisioningState; } + + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ReportPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ReportPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).ReportPrefix = value ?? null; } + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusEnum; } + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusError; } + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusFinishTime; } + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectFailedCount; } + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsOperatedOnCount; } + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsSucceededCount; } + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusObjectsTargetedCount; } + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusRunResult; } + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStartTime; } + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusStorageAccountId; } + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusSummaryReportPath; } + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskAssignmentId; } + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskId; } + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).RunStatusTaskVersion; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TargetExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TargetExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TargetPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TargetPrefix = value ?? null /* arrayOf */; } + + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string TaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TaskId; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TriggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)Property).TriggerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType)""); } + + /// Creates an new instance. + public StorageTaskAssignmentUpdateParameters() + { + + } + } + /// Parameters of the storage task assignment update request + public partial interface IStorageTaskAssignmentUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the provisioning state of the storage task assignment.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix of the storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string ReportPrefix { get; set; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusFinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string RunStatusSummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskVersion { get; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Id of the corresponding storage task", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } + /// Parameters of the storage task assignment update request + internal partial interface IStorageTaskAssignmentUpdateParametersInternal + + { + /// Text that describes the purpose of the storage task assignment + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + bool? Enabled { get; set; } + /// The storage task assignment execution context + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext ExecutionContext { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget ExecutionContextTarget { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate ExecutionContextTrigger { get; set; } + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Properties of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties Property { get; set; } + /// Represents the provisioning state of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// The storage task assignment report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport Report { get; set; } + /// The prefix of the storage task assignment report + string ReportPrefix { get; set; } + /// Run status of storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusFinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsTargetedCount { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusStartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string RunStatusStorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string RunStatusSummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string RunStatusTaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string RunStatusTaskId { get; set; } + /// Storage Task Version + string RunStatusTaskVersion { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + string TaskId { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.json.cs new file mode 100644 index 000000000000..31906e64cb52 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateParameters.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Parameters of the storage task assignment update request + public partial class StorageTaskAssignmentUpdateParameters + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentUpdateParameters(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 StorageTaskAssignmentUpdateParameters(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.Api20230501.StorageTaskAssignmentUpdateProperties.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; + } + 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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.PowerShell.cs new file mode 100644 index 000000000000..839666566e07 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.PowerShell.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.Models.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the storage task update assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdatePropertiesTypeConverter))] + public partial class StorageTaskAssignmentUpdateProperties + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentUpdateProperties(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.Api20230501.IStorageTaskAssignmentUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentUpdateProperties(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.Api20230501.IStorageTaskAssignmentUpdateProperties 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 StorageTaskAssignmentUpdateProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartOn, (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 StorageTaskAssignmentUpdateProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContext = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext) content.GetValueForProperty("ExecutionContext",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContext, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContextTypeConverter.ConvertFrom); + } + if (content.Contains("Report")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Report = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport) content.GetValueForProperty("Report",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Report, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReportTypeConverter.ConvertFrom); + } + if (content.Contains("RunStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("RunStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("RunStatusRunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusRunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunStatusRunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusRunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("ExecutionContextTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTarget = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget) content.GetValueForProperty("ExecutionContextTarget",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTarget, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionContextTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate) content.GetValueForProperty("ExecutionContextTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ExecutionContextTrigger, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ExecutionTriggerUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("TriggerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType?) content.GetValueForProperty("TriggerType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType.CreateFrom); + } + if (content.Contains("ReportPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ReportPrefix = (string) content.GetValueForProperty("ReportPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ReportPrefix, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskAssignmentId = (string) content.GetValueForProperty("RunStatusTaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStorageAccountId = (string) content.GetValueForProperty("RunStatusStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStartTime = (string) content.GetValueForProperty("RunStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusFinishTime = (string) content.GetValueForProperty("RunStatusFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusFinishTime, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsTargetedCount = (string) content.GetValueForProperty("RunStatusObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsOperatedOnCount = (string) content.GetValueForProperty("RunStatusObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectFailedCount = (string) content.GetValueForProperty("RunStatusObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsSucceededCount = (string) content.GetValueForProperty("RunStatusObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("RunStatusSummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusSummaryReportPath = (string) content.GetValueForProperty("RunStatusSummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusSummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskId = (string) content.GetValueForProperty("RunStatusTaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskId, global::System.Convert.ToString); + } + if (content.Contains("RunStatusTaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskVersion = (string) content.GetValueForProperty("RunStatusTaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).RunStatusTaskVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetPrefix = (string[]) content.GetValueForProperty("TargetPrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetExcludePrefix = (string[]) content.GetValueForProperty("TargetExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TargetExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TriggerParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate) content.GetValueForProperty("TriggerParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).TriggerParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TriggerParametersUpdateTypeConverter.ConvertFrom); + } + if (content.Contains("ParameterIntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterIntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("ParameterIntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterIntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("ParameterStartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartFrom = (global::System.DateTime?) content.GetValueForProperty("ParameterStartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterInterval = (int?) content.GetValueForProperty("ParameterInterval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterInterval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ParameterEndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterEndBy = (global::System.DateTime?) content.GetValueForProperty("ParameterEndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterEndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterStartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartOn = (global::System.DateTime?) content.GetValueForProperty("ParameterStartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal)this).ParameterStartOn, (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 the storage task update assignment. + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdatePropertiesTypeConverter))] + public partial interface IStorageTaskAssignmentUpdateProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.TypeConverter.cs new file mode 100644 index 000000000000..21864fcbba2d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentUpdatePropertiesTypeConverter : 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.Api20230501.IStorageTaskAssignmentUpdateProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentUpdateProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.cs new file mode 100644 index 000000000000..aac9f49f7917 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.cs @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage task update assignment. + public partial class StorageTaskAssignmentUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Text that describes the purpose of the storage task assignment + [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 bool? _enabled; + + /// Whether the storage task assignment is enabled or not + [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.Api20230501.IStorageTaskAssignmentUpdateExecutionContext _executionContext; + + /// The storage task assignment execution context + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext ExecutionContext { get => (this._executionContext = this._executionContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContext()); set => this._executionContext = value; } + + /// Internal Acessors for ExecutionContext + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.ExecutionContext { get => (this._executionContext = this._executionContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContext()); set { {_executionContext = value;} } } + + /// Internal Acessors for ExecutionContextTarget + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.ExecutionContextTarget { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).Target = value; } + + /// Internal Acessors for ExecutionContextTrigger + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.ExecutionContextTrigger { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).Trigger; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).Trigger = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.Report { get => (this._report = this._report ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReport()); set { {_report = value;} } } + + /// Internal Acessors for RunStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatus { get => (this._runStatus = this._runStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set { {_runStatus = value;} } } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum = value; } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError = value; } + + /// Internal Acessors for RunStatusFinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime = value; } + + /// Internal Acessors for RunStatusObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount = value; } + + /// Internal Acessors for RunStatusObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount = value; } + + /// Internal Acessors for RunStatusObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount = value; } + + /// Internal Acessors for RunStatusObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount = value; } + + /// Internal Acessors for RunStatusRunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult = value; } + + /// Internal Acessors for RunStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime = value; } + + /// Internal Acessors for RunStatusStorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId = value; } + + /// Internal Acessors for RunStatusSummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath = value; } + + /// Internal Acessors for RunStatusTaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId = value; } + + /// Internal Acessors for RunStatusTaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId = value; } + + /// Internal Acessors for RunStatusTaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion = value; } + + /// Internal Acessors for TaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.TaskId { get => this._taskId; set { {_taskId = value;} } } + + /// Internal Acessors for TriggerParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdatePropertiesInternal.TriggerParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TriggerParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TriggerParameter = value; } + + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterEndBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterEndBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterEndBy = value ?? default(global::System.DateTime); } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ParameterInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterInterval = value ?? default(int); } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterIntervalUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterIntervalUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterStartFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterStartFrom = value ?? default(global::System.DateTime); } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterStartOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterStartOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).ParameterStartOn = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? _provisioningState; + + /// Represents the provisioning state of the storage task assignment. + [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.Models.Api20230501.IStorageTaskAssignmentUpdateReport _report; + + /// The storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport Report { get => (this._report = this._report ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReport()); set => this._report = value; } + + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ReportPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)Report).Prefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)Report).Prefix = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties _runStatus; + + /// Run status of storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get => (this._runStatus = this._runStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set => this._runStatus = value; } + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusEnum; } + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunStatusError; } + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusFinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).FinishTime; } + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectFailedCount; } + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsOperatedOnCount; } + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsSucceededCount; } + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).ObjectsTargetedCount; } + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).RunResult; } + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StartTime; } + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).StorageAccountId; } + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusSummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).SummaryReportPath; } + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskAssignmentId; } + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskId; } + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusTaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)RunStatus).TaskVersion; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TargetExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TargetExcludePrefix = value ?? null /* arrayOf */; } + + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] TargetPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TargetPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TargetPrefix = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _taskId; + + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; } + + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TriggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContextInternal)ExecutionContext).TriggerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType)""); } + + /// Creates an new instance. + public StorageTaskAssignmentUpdateProperties() + { + + } + } + /// Properties of the storage task update assignment. + public partial interface IStorageTaskAssignmentUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Text that describes the purpose of the storage task assignment + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the provisioning state of the storage task assignment.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix of the storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string ReportPrefix { get; set; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusFinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string RunStatusObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusStorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string RunStatusSummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string RunStatusTaskVersion { get; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Id of the corresponding storage task", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; } + /// The trigger type of the storage task assignment execution + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } + /// Properties of the storage task update assignment. + internal partial interface IStorageTaskAssignmentUpdatePropertiesInternal + + { + /// Text that describes the purpose of the storage task assignment + string Description { get; set; } + /// Whether the storage task assignment is enabled or not + bool? Enabled { get; set; } + /// The storage task assignment execution context + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateExecutionContext ExecutionContext { get; set; } + /// Execution target of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTarget ExecutionContextTarget { get; set; } + /// Execution trigger of the storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IExecutionTriggerUpdate ExecutionContextTrigger { get; set; } + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterEndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? ParameterInterval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? ParameterIntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? ParameterStartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? ParameterStartOn { get; set; } + /// Represents the provisioning state of the storage task assignment. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// The storage task assignment report + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport Report { get; set; } + /// The prefix of the storage task assignment report + string ReportPrefix { get; set; } + /// Run status of storage task assignment + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties RunStatus { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusFinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusObjectsTargetedCount { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunStatusRunResult { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string RunStatusStartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string RunStatusStorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string RunStatusSummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string RunStatusTaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string RunStatusTaskId { get; set; } + /// Storage Task Version + string RunStatusTaskVersion { get; set; } + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + string[] TargetExcludePrefix { get; set; } + /// Required list of object prefixes to be included for task execution + string[] TargetPrefix { get; set; } + /// Id of the corresponding storage task + string TaskId { get; set; } + /// The trigger parameters of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate TriggerParameter { get; set; } + /// The trigger type of the storage task assignment execution + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType? TriggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.json.cs new file mode 100644 index 000000000000..9e9ccb22b051 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateProperties.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage task update assignment. + public partial class StorageTaskAssignmentUpdateProperties + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentUpdateProperties(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 StorageTaskAssignmentUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_executionContext = If( json?.PropertyT("executionContext"), out var __jsonExecutionContext) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateExecutionContext.FromJson(__jsonExecutionContext) : ExecutionContext;} + {_report = If( json?.PropertyT("report"), out var __jsonReport) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateReport.FromJson(__jsonReport) : Report;} + {_runStatus = If( json?.PropertyT("runStatus"), out var __jsonRunStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties.FromJson(__jsonRunStatus) : RunStatus;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_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._executionContext ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._executionContext.ToJson(null,serializationMode) : null, "executionContext" ,container.Add ); + AddIf( null != this._report ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._report.ToJson(null,serializationMode) : null, "report" ,container.Add ); + AddIf( null != this._runStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._runStatus.ToJson(null,serializationMode) : null, "runStatus" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,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._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 ); + 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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.PowerShell.cs new file mode 100644 index 000000000000..539ceedeef73 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage task assignment report + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateReportTypeConverter))] + public partial class StorageTaskAssignmentUpdateReport + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateReport DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentUpdateReport(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.Api20230501.IStorageTaskAssignmentUpdateReport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentUpdateReport(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.Api20230501.IStorageTaskAssignmentUpdateReport 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 StorageTaskAssignmentUpdateReport(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)this).Prefix = (string) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)this).Prefix, 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 StorageTaskAssignmentUpdateReport(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Prefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)this).Prefix = (string) content.GetValueForProperty("Prefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal)this).Prefix, 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 task assignment report + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentUpdateReportTypeConverter))] + public partial interface IStorageTaskAssignmentUpdateReport + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.TypeConverter.cs new file mode 100644 index 000000000000..3db6ded803e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentUpdateReportTypeConverter : 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.Api20230501.IStorageTaskAssignmentUpdateReport ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentUpdateReport.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateReport.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentUpdateReport.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.cs new file mode 100644 index 000000000000..577fe39b596e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment report + public partial class StorageTaskAssignmentUpdateReport : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReportInternal + { + + /// Backing field for property. + private string _prefix; + + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Prefix { get => this._prefix; set => this._prefix = value; } + + /// Creates an new instance. + public StorageTaskAssignmentUpdateReport() + { + + } + } + /// The storage task assignment report + public partial interface IStorageTaskAssignmentUpdateReport : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The prefix of the storage task assignment report + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix of the storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + string Prefix { get; set; } + + } + /// The storage task assignment report + internal partial interface IStorageTaskAssignmentUpdateReportInternal + + { + /// The prefix of the storage task assignment report + string Prefix { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.json.cs new file mode 100644 index 000000000000..5925b003a95b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentUpdateReport.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage task assignment report + public partial class StorageTaskAssignmentUpdateReport + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentUpdateReport. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateReport FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentUpdateReport(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 StorageTaskAssignmentUpdateReport(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefix = If( json?.PropertyT("prefix"), out var __jsonPrefix) ? (string)__jsonPrefix : (string)Prefix;} + 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._prefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._prefix.ToString()) : null, "prefix" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.PowerShell.cs new file mode 100644 index 000000000000..9e17d8c30ef6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// List of storage task assignments for the storage account + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentsListTypeConverter))] + public partial class StorageTaskAssignmentsList + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentsList(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.Api20230501.IStorageTaskAssignmentsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentsList(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.Api20230501.IStorageTaskAssignmentsList 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 StorageTaskAssignmentsList(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.Api20230501.IStorageTaskAssignmentsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)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 StorageTaskAssignmentsList(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.Api20230501.IStorageTaskAssignmentsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal)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(); + } + /// List of storage task assignments for the storage account + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentsListTypeConverter))] + public partial interface IStorageTaskAssignmentsList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.TypeConverter.cs new file mode 100644 index 000000000000..590ae0ff83b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentsListTypeConverter : 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.Api20230501.IStorageTaskAssignmentsList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsList.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.cs new file mode 100644 index 000000000000..d1e3421638b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List of storage task assignments for the storage account + public partial class StorageTaskAssignmentsList : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsList, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsListInternal.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 task assignments. Returned when total number of requested storage + /// task assignments 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.Api20230501.IStorageTaskAssignment[] _value; + + /// Gets the list of storage task assignments and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[] Value { get => this._value; } + + /// Creates an new instance. + public StorageTaskAssignmentsList() + { + + } + } + /// List of storage task assignments for the storage account + public partial interface IStorageTaskAssignmentsList : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of storage task assignments. Returned when total number of requested storage + /// task assignments 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 task assignments. Returned when total number of requested storage task assignments exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Gets the list of storage task assignments and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the list of storage task assignments and their properties.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[] Value { get; } + + } + /// List of storage task assignments for the storage account + internal partial interface IStorageTaskAssignmentsListInternal + + { + /// + /// Request URL that can be used to query next page of storage task assignments. Returned when total number of requested storage + /// task assignments exceed maximum page size. + /// + string NextLink { get; set; } + /// Gets the list of storage task assignments and their properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.json.cs new file mode 100644 index 000000000000..1e250088ce11 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskAssignmentsList.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List of storage task assignments for the storage account + public partial class StorageTaskAssignmentsList + { + + /// + /// 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.Api20230501.IStorageTaskAssignmentsList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentsList(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 StorageTaskAssignmentsList(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.Api20230501.IStorageTaskAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignment.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.PowerShell.cs new file mode 100644 index 000000000000..6776dc7e7121 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Storage Tasks run report instance + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportInstanceTypeConverter))] + public partial class StorageTaskReportInstance + { + + /// + /// 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.Api20230501.IStorageTaskReportInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskReportInstance(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.Api20230501.IStorageTaskReportInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskReportInstance(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.Api20230501.IStorageTaskReportInstance 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 StorageTaskReportInstance(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.Api20230501.IStorageTaskReportInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.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("RunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("TaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskAssignmentId = (string) content.GetValueForProperty("TaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("FinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).FinishTime = (string) content.GetValueForProperty("FinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).FinishTime, global::System.Convert.ToString); + } + if (content.Contains("ObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsTargetedCount = (string) content.GetValueForProperty("ObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsOperatedOnCount = (string) content.GetValueForProperty("ObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectFailedCount = (string) content.GetValueForProperty("ObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsSucceededCount = (string) content.GetValueForProperty("ObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("SummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).SummaryReportPath = (string) content.GetValueForProperty("SummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).SummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskVersion = (string) content.GetValueForProperty("TaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskVersion, 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 StorageTaskReportInstance(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.Api20230501.IStorageTaskReportInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportPropertiesTypeConverter.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("RunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + if (content.Contains("TaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskAssignmentId = (string) content.GetValueForProperty("TaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("FinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).FinishTime = (string) content.GetValueForProperty("FinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).FinishTime, global::System.Convert.ToString); + } + if (content.Contains("ObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsTargetedCount = (string) content.GetValueForProperty("ObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsOperatedOnCount = (string) content.GetValueForProperty("ObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectFailedCount = (string) content.GetValueForProperty("ObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsSucceededCount = (string) content.GetValueForProperty("ObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).ObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("SummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).SummaryReportPath = (string) content.GetValueForProperty("SummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).SummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskVersion = (string) content.GetValueForProperty("TaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal)this).TaskVersion, 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(); + } + /// Storage Tasks run report instance + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportInstanceTypeConverter))] + public partial interface IStorageTaskReportInstance + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.TypeConverter.cs new file mode 100644 index 000000000000..623205198387 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskReportInstanceTypeConverter : 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.Api20230501.IStorageTaskReportInstance ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskReportInstance.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskReportInstance.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskReportInstance.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.cs new file mode 100644 index 000000000000..2f359ef81ab8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.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.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage Tasks run report instance + public partial class StorageTaskReportInstance : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal, + 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(); + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string FinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).FinishTime; } + + /// + /// 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 FinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.FinishTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).FinishTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).FinishTime = value; } + + /// Internal Acessors for ObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.ObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectFailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectFailedCount = value; } + + /// Internal Acessors for ObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.ObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsOperatedOnCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsOperatedOnCount = value; } + + /// Internal Acessors for ObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.ObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsSucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsSucceededCount = value; } + + /// Internal Acessors for ObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.ObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsTargetedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsTargetedCount = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set { {_property = value;} } } + + /// Internal Acessors for RunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.RunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunResult = value; } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusEnum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusEnum = value; } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusError = value; } + + /// Internal Acessors for StartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StartTime = value; } + + /// Internal Acessors for StorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StorageAccountId = value; } + + /// Internal Acessors for SummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.SummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).SummaryReportPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).SummaryReportPath = value; } + + /// Internal Acessors for TaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.TaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskAssignmentId = value; } + + /// Internal Acessors for TaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.TaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskId = value; } + + /// Internal Acessors for TaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstanceInternal.TaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskVersion = 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; } + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ObjectFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectFailedCount; } + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ObjectsOperatedOnCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsOperatedOnCount; } + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ObjectsSucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsSucceededCount; } + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ObjectsTargetedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).ObjectsTargetedCount; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties _property; + + /// Storage task execution report for a run instance. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportProperties()); set => this._property = value; } + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunResult; } + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusEnum; } + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RunStatusError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).RunStatusError; } + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StartTime; } + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).StorageAccountId; } + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SummaryReportPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).SummaryReportPath; } + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string TaskAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskAssignmentId; } + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string TaskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskId; } + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string TaskVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)Property).TaskVersion; } + + /// + /// 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 StorageTaskReportInstance() + { + + } + + /// 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); + } + } + /// Storage Tasks run report instance + public partial interface IStorageTaskReportInstance : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string FinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string StartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string SummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string TaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string TaskVersion { get; } + + } + /// Storage Tasks run report instance + internal partial interface IStorageTaskReportInstanceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string FinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsTargetedCount { get; set; } + /// Storage task execution report for a run instance. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties Property { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string StartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string StorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string SummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string TaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string TaskId { get; set; } + /// Storage Task Version + string TaskVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.json.cs new file mode 100644 index 000000000000..4fbd213230f8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportInstance.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage Tasks run report instance + public partial class StorageTaskReportInstance + { + + /// + /// 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.Api20230501.IStorageTaskReportInstance. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskReportInstance(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 StorageTaskReportInstance(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.Api20230501.StorageTaskReportProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.PowerShell.cs new file mode 100644 index 000000000000..47d4a37cd8c0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.PowerShell.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Storage task execution report for a run instance. + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportPropertiesTypeConverter))] + public partial class StorageTaskReportProperties + { + + /// + /// 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.Api20230501.IStorageTaskReportProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskReportProperties(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.Api20230501.IStorageTaskReportProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskReportProperties(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.Api20230501.IStorageTaskReportProperties 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 StorageTaskReportProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskAssignmentId = (string) content.GetValueForProperty("TaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("FinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).FinishTime = (string) content.GetValueForProperty("FinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).FinishTime, global::System.Convert.ToString); + } + if (content.Contains("ObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsTargetedCount = (string) content.GetValueForProperty("ObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsOperatedOnCount = (string) content.GetValueForProperty("ObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectFailedCount = (string) content.GetValueForProperty("ObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsSucceededCount = (string) content.GetValueForProperty("ObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("SummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).SummaryReportPath = (string) content.GetValueForProperty("SummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).SummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskVersion = (string) content.GetValueForProperty("TaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskVersion, global::System.Convert.ToString); + } + if (content.Contains("RunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageTaskReportProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskAssignmentId = (string) content.GetValueForProperty("TaskAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("FinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).FinishTime = (string) content.GetValueForProperty("FinishTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).FinishTime, global::System.Convert.ToString); + } + if (content.Contains("ObjectsTargetedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsTargetedCount = (string) content.GetValueForProperty("ObjectsTargetedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsTargetedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsOperatedOnCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsOperatedOnCount = (string) content.GetValueForProperty("ObjectsOperatedOnCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsOperatedOnCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectFailedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectFailedCount = (string) content.GetValueForProperty("ObjectFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectFailedCount, global::System.Convert.ToString); + } + if (content.Contains("ObjectsSucceededCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsSucceededCount = (string) content.GetValueForProperty("ObjectsSucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).ObjectsSucceededCount, global::System.Convert.ToString); + } + if (content.Contains("RunStatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusError = (string) content.GetValueForProperty("RunStatusError",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusError, global::System.Convert.ToString); + } + if (content.Contains("RunStatusEnum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusEnum = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum?) content.GetValueForProperty("RunStatusEnum",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunStatusEnum, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum.CreateFrom); + } + if (content.Contains("SummaryReportPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).SummaryReportPath = (string) content.GetValueForProperty("SummaryReportPath",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).SummaryReportPath, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskVersion = (string) content.GetValueForProperty("TaskVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).TaskVersion, global::System.Convert.ToString); + } + if (content.Contains("RunResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunResult = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult?) content.GetValueForProperty("RunResult",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal)this).RunResult, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult.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(); + } + /// Storage task execution report for a run instance. + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportPropertiesTypeConverter))] + public partial interface IStorageTaskReportProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.TypeConverter.cs new file mode 100644 index 000000000000..100121427f94 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskReportPropertiesTypeConverter : 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.Api20230501.IStorageTaskReportProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskReportProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskReportProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskReportProperties.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.cs new file mode 100644 index 000000000000..ebb26a58d5cc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage task execution report for a run instance. + public partial class StorageTaskReportProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal + { + + /// Backing field for property. + private string _finishTime; + + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string FinishTime { get => this._finishTime; } + + /// Internal Acessors for FinishTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.FinishTime { get => this._finishTime; set { {_finishTime = value;} } } + + /// Internal Acessors for ObjectFailedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.ObjectFailedCount { get => this._objectFailedCount; set { {_objectFailedCount = value;} } } + + /// Internal Acessors for ObjectsOperatedOnCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.ObjectsOperatedOnCount { get => this._objectsOperatedOnCount; set { {_objectsOperatedOnCount = value;} } } + + /// Internal Acessors for ObjectsSucceededCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.ObjectsSucceededCount { get => this._objectsSucceededCount; set { {_objectsSucceededCount = value;} } } + + /// Internal Acessors for ObjectsTargetedCount + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.ObjectsTargetedCount { get => this._objectsTargetedCount; set { {_objectsTargetedCount = value;} } } + + /// Internal Acessors for RunResult + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.RunResult { get => this._runResult; set { {_runResult = value;} } } + + /// Internal Acessors for RunStatusEnum + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.RunStatusEnum { get => this._runStatusEnum; set { {_runStatusEnum = value;} } } + + /// Internal Acessors for RunStatusError + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.RunStatusError { get => this._runStatusError; set { {_runStatusError = value;} } } + + /// Internal Acessors for StartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + + /// Internal Acessors for StorageAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.StorageAccountId { get => this._storageAccountId; set { {_storageAccountId = value;} } } + + /// Internal Acessors for SummaryReportPath + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.SummaryReportPath { get => this._summaryReportPath; set { {_summaryReportPath = value;} } } + + /// Internal Acessors for TaskAssignmentId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.TaskAssignmentId { get => this._taskAssignmentId; set { {_taskAssignmentId = value;} } } + + /// Internal Acessors for TaskId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.TaskId { get => this._taskId; set { {_taskId = value;} } } + + /// Internal Acessors for TaskVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportPropertiesInternal.TaskVersion { get => this._taskVersion; set { {_taskVersion = value;} } } + + /// Backing field for property. + private string _objectFailedCount; + + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectFailedCount { get => this._objectFailedCount; } + + /// Backing field for property. + private string _objectsOperatedOnCount; + + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectsOperatedOnCount { get => this._objectsOperatedOnCount; } + + /// Backing field for property. + private string _objectsSucceededCount; + + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectsSucceededCount { get => this._objectsSucceededCount; } + + /// Backing field for property. + private string _objectsTargetedCount; + + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectsTargetedCount { get => this._objectsTargetedCount; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? _runResult; + + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get => this._runResult; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? _runStatusEnum; + + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get => this._runStatusEnum; } + + /// Backing field for property. + private string _runStatusError; + + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RunStatusError { get => this._runStatusError; } + + /// Backing field for property. + private string _startTime; + + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string StartTime { get => this._startTime; } + + /// Backing field for property. + private string _storageAccountId; + + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string StorageAccountId { get => this._storageAccountId; } + + /// Backing field for property. + private string _summaryReportPath; + + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SummaryReportPath { get => this._summaryReportPath; } + + /// Backing field for property. + private string _taskAssignmentId; + + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TaskAssignmentId { get => this._taskAssignmentId; } + + /// Backing field for property. + private string _taskId; + + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; } + + /// Backing field for property. + private string _taskVersion; + + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TaskVersion { get => this._taskVersion; } + + /// Creates an new instance. + public StorageTaskReportProperties() + { + + } + } + /// Storage task execution report for a run instance. + public partial interface IStorageTaskReportProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"finishTime", + PossibleTypes = new [] { typeof(string) })] + string FinishTime { get; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectFailedCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectFailedCount { get; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsOperatedOnCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsOperatedOnCount { get; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsSucceededCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsSucceededCount { get; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"objectsTargetedCount", + PossibleTypes = new [] { typeof(string) })] + string ObjectsTargetedCount { get; } + /// Represents the overall result of the execution for the run instance + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the overall result of the execution for the run instance", + SerializedName = @"runResult", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get; } + /// Represents the status of the execution. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the status of the execution.", + SerializedName = @"runStatusEnum", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Well known Azure Storage error code that represents the error encountered during execution of the run instance.", + SerializedName = @"runStatusError", + PossibleTypes = new [] { typeof(string) })] + string RunStatusError { get; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string StartTime { get; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Account Id where the storage task definition was applied and executed.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountId { get; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. ", + SerializedName = @"summaryReportPath", + PossibleTypes = new [] { typeof(string) })] + string SummaryReportPath { get; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.", + SerializedName = @"taskAssignmentId", + PossibleTypes = new [] { typeof(string) })] + string TaskAssignmentId { get; } + /// Storage Task Arm Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Arm Id.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; } + /// Storage Task Version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage Task Version", + SerializedName = @"taskVersion", + PossibleTypes = new [] { typeof(string) })] + string TaskVersion { get; } + + } + /// Storage task execution report for a run instance. + internal partial interface IStorageTaskReportPropertiesInternal + + { + /// + /// End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string FinishTime { get; set; } + /// + /// Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 + /// and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectFailedCount { get; set; } + /// + /// Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount + /// ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsOperatedOnCount { get; set; } + /// + /// Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount + /// gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsSucceededCount { get; set; } + /// + /// Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options + /// such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in + /// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string ObjectsTargetedCount { get; set; } + /// Represents the overall result of the execution for the run instance + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult? RunResult { get; set; } + /// Represents the status of the execution. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum? RunStatusEnum { get; set; } + /// + /// Well known Azure Storage error code that represents the error encountered during execution of the run instance. + /// + string RunStatusError { get; set; } + /// + /// Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison + /// operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + /// + string StartTime { get; set; } + /// + /// Represents the Storage Account Id where the storage task definition was applied and executed. + /// + string StorageAccountId { get; set; } + /// + /// Full path to the verbose report stored in the reporting container as specified in the assignment execution context for + /// the storage account. + /// + string SummaryReportPath { get; set; } + /// + /// Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + /// + string TaskAssignmentId { get; set; } + /// Storage Task Arm Id. + string TaskId { get; set; } + /// Storage Task Version + string TaskVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.json.cs new file mode 100644 index 000000000000..63f90d920b3f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportProperties.json.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage task execution report for a run instance. + public partial class StorageTaskReportProperties + { + + /// + /// 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.Api20230501.IStorageTaskReportProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskReportProperties(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 StorageTaskReportProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskAssignmentId = If( json?.PropertyT("taskAssignmentId"), out var __jsonTaskAssignmentId) ? (string)__jsonTaskAssignmentId : (string)TaskAssignmentId;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? (string)__jsonStartTime : (string)StartTime;} + {_finishTime = If( json?.PropertyT("finishTime"), out var __jsonFinishTime) ? (string)__jsonFinishTime : (string)FinishTime;} + {_objectsTargetedCount = If( json?.PropertyT("objectsTargetedCount"), out var __jsonObjectsTargetedCount) ? (string)__jsonObjectsTargetedCount : (string)ObjectsTargetedCount;} + {_objectsOperatedOnCount = If( json?.PropertyT("objectsOperatedOnCount"), out var __jsonObjectsOperatedOnCount) ? (string)__jsonObjectsOperatedOnCount : (string)ObjectsOperatedOnCount;} + {_objectFailedCount = If( json?.PropertyT("objectFailedCount"), out var __jsonObjectFailedCount) ? (string)__jsonObjectFailedCount : (string)ObjectFailedCount;} + {_objectsSucceededCount = If( json?.PropertyT("objectsSucceededCount"), out var __jsonObjectsSucceededCount) ? (string)__jsonObjectsSucceededCount : (string)ObjectsSucceededCount;} + {_runStatusError = If( json?.PropertyT("runStatusError"), out var __jsonRunStatusError) ? (string)__jsonRunStatusError : (string)RunStatusError;} + {_runStatusEnum = If( json?.PropertyT("runStatusEnum"), out var __jsonRunStatusEnum) ? (string)__jsonRunStatusEnum : (string)RunStatusEnum;} + {_summaryReportPath = If( json?.PropertyT("summaryReportPath"), out var __jsonSummaryReportPath) ? (string)__jsonSummaryReportPath : (string)SummaryReportPath;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_taskVersion = If( json?.PropertyT("taskVersion"), out var __jsonTaskVersion) ? (string)__jsonTaskVersion : (string)TaskVersion;} + {_runResult = If( json?.PropertyT("runResult"), out var __jsonRunResult) ? (string)__jsonRunResult : (string)RunResult;} + 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._taskAssignmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._taskAssignmentId.ToString()) : null, "taskAssignmentId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._storageAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._storageAccountId.ToString()) : null, "storageAccountId" ,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._finishTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._finishTime.ToString()) : null, "finishTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectsTargetedCount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectsTargetedCount.ToString()) : null, "objectsTargetedCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectsOperatedOnCount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectsOperatedOnCount.ToString()) : null, "objectsOperatedOnCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectFailedCount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectFailedCount.ToString()) : null, "objectFailedCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectsSucceededCount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectsSucceededCount.ToString()) : null, "objectsSucceededCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._runStatusError)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._runStatusError.ToString()) : null, "runStatusError" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._runStatusEnum)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._runStatusEnum.ToString()) : null, "runStatusEnum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._summaryReportPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._summaryReportPath.ToString()) : null, "summaryReportPath" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._taskVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._taskVersion.ToString()) : null, "taskVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._runResult)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._runResult.ToString()) : null, "runResult" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.PowerShell.cs new file mode 100644 index 000000000000..ef53a3486c09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Fetch Storage Tasks Run Summary. + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportSummaryTypeConverter))] + public partial class StorageTaskReportSummary + { + + /// + /// 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.Api20230501.IStorageTaskReportSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskReportSummary(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.Api20230501.IStorageTaskReportSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskReportSummary(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.Api20230501.IStorageTaskReportSummary 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 StorageTaskReportSummary(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.Api20230501.IStorageTaskReportSummaryInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportInstanceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)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 StorageTaskReportSummary(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.Api20230501.IStorageTaskReportSummaryInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportInstanceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal)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(); + } + /// Fetch Storage Tasks Run Summary. + [System.ComponentModel.TypeConverter(typeof(StorageTaskReportSummaryTypeConverter))] + public partial interface IStorageTaskReportSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.TypeConverter.cs new file mode 100644 index 000000000000..9d4e4cd77e6b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskReportSummaryTypeConverter : 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.Api20230501.IStorageTaskReportSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskReportSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskReportSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskReportSummary.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.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.cs new file mode 100644 index 000000000000..d18fb8a6c2fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Fetch Storage Tasks Run Summary. + public partial class StorageTaskReportSummary : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummary, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummaryInternal.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 task run results summary. Returned when the number of run instances + /// and summary reports 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.Api20230501.IStorageTaskReportInstance[] _value; + + /// Gets storage tasks run result summary. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[] Value { get => this._value; } + + /// Creates an new instance. + public StorageTaskReportSummary() + { + + } + } + /// Fetch Storage Tasks Run Summary. + public partial interface IStorageTaskReportSummary : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of storage task run results summary. Returned when the number of run instances + /// and summary reports 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 task run results summary. Returned when the number of run instances and summary reports exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Gets storage tasks run result summary. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets storage tasks run result summary.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[] Value { get; } + + } + /// Fetch Storage Tasks Run Summary. + internal partial interface IStorageTaskReportSummaryInternal + + { + /// + /// Request URL that can be used to query next page of storage task run results summary. Returned when the number of run instances + /// and summary reports exceed maximum page size. + /// + string NextLink { get; set; } + /// Gets storage tasks run result summary. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.json.cs new file mode 100644 index 000000000000..2f4cb929bf09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/StorageTaskReportSummary.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Fetch Storage Tasks Run Summary. + public partial class StorageTaskReportSummary + { + + /// + /// 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.Api20230501.IStorageTaskReportSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskReportSummary(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 StorageTaskReportSummary(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.Api20230501.IStorageTaskReportInstance) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskReportInstance.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.DefaultTag/generated/api/Models/Api20230501/Table.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Table.PowerShell.cs new file mode 100644 index 000000000000..894b3b342d30 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITableInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableInternal)this).PropertyTableName = (string) content.GetValueForProperty("PropertyTableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertyTableName, global::System.Convert.ToString); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableInternal)this).PropertyTableName = (string) content.GetValueForProperty("PropertyTableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertyTableName, global::System.Convert.ToString); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Table.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Table.TypeConverter.cs new file mode 100644 index 000000000000..d1d8622f9dcb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITable ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Table.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Table.cs new file mode 100644 index 000000000000..88e739fd1c71 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyTableName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableInternal.PropertyTableName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)Property).TableName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITableProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifier[] PropertySignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITableSignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableProperties Property { get; set; } + /// List of stored access policies specified on the table. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Table.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Table.json.cs new file mode 100644 index 000000000000..6f20c2f482ad --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITable. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITable. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.PowerShell.cs new file mode 100644 index 000000000000..da6a286061c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.TypeConverter.cs new file mode 100644 index 000000000000..e988a1b762d5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableAccessPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.cs new file mode 100644 index 000000000000..3dfbacde08ed --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Table Access Policy Properties Object. + public partial class TableAccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableAccessPolicy.json.cs new file mode 100644 index 000000000000..815b1a5533df --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableAccessPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableProperties.PowerShell.cs new file mode 100644 index 000000000000..c401db559117 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITablePropertiesInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITablePropertiesInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableProperties.TypeConverter.cs new file mode 100644 index 000000000000..089d9fa424de --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableProperties.cs new file mode 100644 index 000000000000..97a85e4cbf81 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class TableProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal + { + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITablePropertiesInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITableSignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableProperties.json.cs new file mode 100644 index 000000000000..ed1b9c5b59b6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifier) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..d41f628b8634 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITableServicePropertiesInternal)this).TableServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGenerated) content.GetValueForProperty("TableServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).TableServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServicePropertiesInternal)this).TableServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("TableServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).TableServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServicePropertiesInternal)this).TableServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGenerated) content.GetValueForProperty("TableServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).TableServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServicePropertiesInternal)this).TableServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("TableServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).TableServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..f175b3085ee5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.cs new file mode 100644 index 000000000000..04222f5773b1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal.TableServiceProperty { get => (this._tableServiceProperty = this._tableServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableServicePropertiesAutoGenerated()); set { {_tableServiceProperty = value;} } } + + /// Internal Acessors for TableServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesInternal.TableServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ITableServicePropertiesAutoGenerated TableServiceProperty { get => (this._tableServiceProperty = this._tableServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of a storage account’s Table service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules TableServicePropertyCor { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServiceProperties.json.cs new file mode 100644 index 000000000000..9fd3ba53962d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..bce0a7774414 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..5b2a1b41610f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..c3ada51fe8a3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.ICorsRule[] CorCorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..354664010cfc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.PowerShell.cs new file mode 100644 index 000000000000..ae322b70181f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableAccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.TableAccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableSignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.TypeConverter.cs new file mode 100644 index 000000000000..85661bd45d0b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableSignedIdentifier ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.cs new file mode 100644 index 000000000000..b42e5fe1e3e7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableSignedIdentifier, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy _accessPolicy; + + /// Access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableAccessPolicy AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)AccessPolicy).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)AccessPolicy).Permission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicyInternal)AccessPolicy).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITableAccessPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifierInternal.AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TableSignedIdentifier.json.cs new file mode 100644 index 000000000000..61fb5b17f2d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITableSignedIdentifier. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITableSignedIdentifier. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagFilter.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagFilter.PowerShell.cs new file mode 100644 index 000000000000..5cb440c61e87 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITagFilterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Op")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Op = (string) content.GetValueForProperty("Op",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Op, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagFilterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Op")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Op = (string) content.GetValueForProperty("Op",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Op, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagFilter.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagFilter.TypeConverter.cs new file mode 100644 index 000000000000..0acf5639494a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagFilter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagFilter.cs new file mode 100644 index 000000000000..5a5a4e979acf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagFilter.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagFilter.json.cs new file mode 100644 index 000000000000..dd5df91f40fe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagProperty.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagProperty.PowerShell.cs new file mode 100644 index 000000000000..19095d5a97d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.ITagPropertyInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagPropertyInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ITagPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagProperty.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagProperty.TypeConverter.cs new file mode 100644 index 000000000000..ae5e0dedfb33 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagProperty.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagProperty.cs new file mode 100644 index 000000000000..a990e7962f17 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal + { + + /// Internal Acessors for ObjectIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal.ObjectIdentifier { get => this._objectIdentifier; set { {_objectIdentifier = value;} } } + + /// Internal Acessors for Tag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal.Tag { get => this._tag; set { {_tag = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Internal Acessors for Timestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagPropertyInternal.Timestamp { get => this._timestamp; set { {_timestamp = value;} } } + + /// Internal Acessors for Upn + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TagProperty.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TagProperty.json.cs new file mode 100644 index 000000000000..a62896513e86 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.ITagProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITagProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.PowerShell.cs new file mode 100644 index 000000000000..89298747320a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The trigger parameters update for the storage task assignment execution + [System.ComponentModel.TypeConverter(typeof(TriggerParametersTypeConverter))] + public partial class TriggerParameters + { + + /// + /// 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.Api20230501.ITriggerParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TriggerParameters(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.Api20230501.ITriggerParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TriggerParameters(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.Api20230501.ITriggerParameters 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 TriggerParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartFrom = (global::System.DateTime?) content.GetValueForProperty("StartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Interval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).Interval = (int?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).Interval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).IntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("IntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).IntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("EndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).EndBy = (global::System.DateTime?) content.GetValueForProperty("EndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).EndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartOn = (global::System.DateTime?) content.GetValueForProperty("StartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartOn, (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 TriggerParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartFrom = (global::System.DateTime?) content.GetValueForProperty("StartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Interval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).Interval = (int?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).Interval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).IntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("IntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).IntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("EndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).EndBy = (global::System.DateTime?) content.GetValueForProperty("EndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).EndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartOn = (global::System.DateTime?) content.GetValueForProperty("StartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal)this).StartOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// The trigger parameters update for the storage task assignment execution + [System.ComponentModel.TypeConverter(typeof(TriggerParametersTypeConverter))] + public partial interface ITriggerParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.TypeConverter.cs new file mode 100644 index 000000000000..607ff451041c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TriggerParametersTypeConverter : 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.Api20230501.ITriggerParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TriggerParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TriggerParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TriggerParameters.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.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.cs new file mode 100644 index 000000000000..9cf26a8a7388 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The trigger parameters update for the storage task assignment execution + public partial class TriggerParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersInternal + { + + /// Backing field for property. + private global::System.DateTime? _endBy; + + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? EndBy { get => this._endBy; set => this._endBy = value; } + + /// Backing field for property. + private int? _interval; + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? Interval { get => this._interval; set => this._interval = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? _intervalUnit; + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get => this._intervalUnit; set => this._intervalUnit = value; } + + /// Backing field for property. + private global::System.DateTime? _startFrom; + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartFrom { get => this._startFrom; set => this._startFrom = value; } + + /// Backing field for property. + private global::System.DateTime? _startOn; + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartOn { get => this._startOn; set => this._startOn = value; } + + /// Creates an new instance. + public TriggerParameters() + { + + } + } + /// The trigger parameters update for the storage task assignment execution + public partial interface ITriggerParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? Interval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartOn { get; set; } + + } + /// The trigger parameters update for the storage task assignment execution + internal partial interface ITriggerParametersInternal + + { + /// + /// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? EndBy { get; set; } + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? Interval { get; set; } + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get; set; } + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? StartFrom { get; set; } + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? StartOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.json.cs new file mode 100644 index 000000000000..a0e56faa51ea --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParameters.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The trigger parameters update for the storage task assignment execution + public partial class TriggerParameters + { + + /// + /// 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.Api20230501.ITriggerParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TriggerParameters(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._startFrom ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startFrom?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startFrom" ,container.Add ); + AddIf( null != this._interval ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._interval) : null, "interval" ,container.Add ); + AddIf( null != (((object)this._intervalUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._intervalUnit.ToString()) : null, "intervalUnit" ,container.Add ); + AddIf( null != this._endBy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._endBy?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endBy" ,container.Add ); + AddIf( null != this._startOn ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startOn" ,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 TriggerParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startFrom = If( json?.PropertyT("startFrom"), out var __jsonStartFrom) ? global::System.DateTime.TryParse((string)__jsonStartFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartFromValue) ? __jsonStartFromValue : StartFrom : StartFrom;} + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? (int?)__jsonInterval : Interval;} + {_intervalUnit = If( json?.PropertyT("intervalUnit"), out var __jsonIntervalUnit) ? (string)__jsonIntervalUnit : (string)IntervalUnit;} + {_endBy = If( json?.PropertyT("endBy"), out var __jsonEndBy) ? global::System.DateTime.TryParse((string)__jsonEndBy, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndByValue) ? __jsonEndByValue : EndBy : EndBy;} + {_startOn = If( json?.PropertyT("startOn"), out var __jsonStartOn) ? global::System.DateTime.TryParse((string)__jsonStartOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartOnValue) ? __jsonStartOnValue : StartOn : StartOn;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.PowerShell.cs new file mode 100644 index 000000000000..379294201e59 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The trigger parameters update for the storage task assignment execution + [System.ComponentModel.TypeConverter(typeof(TriggerParametersUpdateTypeConverter))] + public partial class TriggerParametersUpdate + { + + /// + /// 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.Api20230501.ITriggerParametersUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TriggerParametersUpdate(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.Api20230501.ITriggerParametersUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TriggerParametersUpdate(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.Api20230501.ITriggerParametersUpdate 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 TriggerParametersUpdate(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartFrom = (global::System.DateTime?) content.GetValueForProperty("StartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Interval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).Interval = (int?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).Interval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).IntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("IntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).IntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("EndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).EndBy = (global::System.DateTime?) content.GetValueForProperty("EndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).EndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartOn = (global::System.DateTime?) content.GetValueForProperty("StartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartOn, (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 TriggerParametersUpdate(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartFrom = (global::System.DateTime?) content.GetValueForProperty("StartFrom",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Interval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).Interval = (int?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).Interval, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IntervalUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).IntervalUnit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit?) content.GetValueForProperty("IntervalUnit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).IntervalUnit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit.CreateFrom); + } + if (content.Contains("EndBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).EndBy = (global::System.DateTime?) content.GetValueForProperty("EndBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).EndBy, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartOn = (global::System.DateTime?) content.GetValueForProperty("StartOn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal)this).StartOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// The trigger parameters update for the storage task assignment execution + [System.ComponentModel.TypeConverter(typeof(TriggerParametersUpdateTypeConverter))] + public partial interface ITriggerParametersUpdate + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.TypeConverter.cs new file mode 100644 index 000000000000..47c1aab7f532 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.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.Api20230501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TriggerParametersUpdateTypeConverter : 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.Api20230501.ITriggerParametersUpdate ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TriggerParametersUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TriggerParametersUpdate.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TriggerParametersUpdate.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.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.cs new file mode 100644 index 000000000000..9f761e115bff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The trigger parameters update for the storage task assignment execution + public partial class TriggerParametersUpdate : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdateInternal + { + + /// Backing field for property. + private global::System.DateTime? _endBy; + + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? EndBy { get => this._endBy; set => this._endBy = value; } + + /// Backing field for property. + private int? _interval; + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? Interval { get => this._interval; set => this._interval = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? _intervalUnit; + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get => this._intervalUnit; set => this._intervalUnit = value; } + + /// Backing field for property. + private global::System.DateTime? _startFrom; + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartFrom { get => this._startFrom; set => this._startFrom = value; } + + /// Backing field for property. + private global::System.DateTime? _startOn; + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartOn { get => this._startOn; set => this._startOn = value; } + + /// Creates an new instance. + public TriggerParametersUpdate() + { + + } + } + /// The trigger parameters update for the storage task assignment execution + public partial interface ITriggerParametersUpdate : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? Interval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartOn { get; set; } + + } + /// The trigger parameters update for the storage task assignment execution + internal partial interface ITriggerParametersUpdateInternal + + { + /// + /// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? EndBy { get; set; } + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + int? Interval { get; set; } + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit? IntervalUnit { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + global::System.DateTime? StartFrom { get; set; } + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + global::System.DateTime? StartOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.json.cs new file mode 100644 index 000000000000..0ab94c122e31 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/TriggerParametersUpdate.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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The trigger parameters update for the storage task assignment execution + public partial class TriggerParametersUpdate + { + + /// + /// 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.Api20230501.ITriggerParametersUpdate. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ITriggerParametersUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TriggerParametersUpdate(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._startFrom ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startFrom?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startFrom" ,container.Add ); + AddIf( null != this._interval ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._interval) : null, "interval" ,container.Add ); + AddIf( null != (((object)this._intervalUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._intervalUnit.ToString()) : null, "intervalUnit" ,container.Add ); + AddIf( null != this._endBy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._endBy?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endBy" ,container.Add ); + AddIf( null != this._startOn ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startOn" ,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 TriggerParametersUpdate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startFrom = If( json?.PropertyT("startFrom"), out var __jsonStartFrom) ? global::System.DateTime.TryParse((string)__jsonStartFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartFromValue) ? __jsonStartFromValue : StartFrom : StartFrom;} + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? (int?)__jsonInterval : Interval;} + {_intervalUnit = If( json?.PropertyT("intervalUnit"), out var __jsonIntervalUnit) ? (string)__jsonIntervalUnit : (string)IntervalUnit;} + {_endBy = If( json?.PropertyT("endBy"), out var __jsonEndBy) ? global::System.DateTime.TryParse((string)__jsonEndBy, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndByValue) ? __jsonEndByValue : EndBy : EndBy;} + {_startOn = If( json?.PropertyT("startOn"), out var __jsonStartOn) ? global::System.DateTime.TryParse((string)__jsonStartOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartOnValue) ? __jsonStartOnValue : StartOn : StartOn;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.PowerShell.cs new file mode 100644 index 000000000000..cd1f547978c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType?) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Update, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType.CreateFrom); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Upn, global::System.Convert.ToString); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType?) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Update, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType.CreateFrom); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).Upn, global::System.Convert.ToString); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.TypeConverter.cs new file mode 100644 index 000000000000..f2a6d20fd174 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUpdateHistoryProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.cs new file mode 100644 index 000000000000..0a923131cf59 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUpdateHistoryProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal.ImmutabilityPeriodSinceCreationInDay { get => this._immutabilityPeriodSinceCreationInDay; set { {_immutabilityPeriodSinceCreationInDay = value;} } } + + /// Internal Acessors for ObjectIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal.ObjectIdentifier { get => this._objectIdentifier; set { {_objectIdentifier = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryPropertyInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Internal Acessors for Timestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUpdateHistoryPropertyInternal.Update { get => this._update; set { {_update = value;} } } + + /// Internal Acessors for Upn + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UpdateHistoryProperty.json.cs new file mode 100644 index 000000000000..e88d75736ca3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUpdateHistoryProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUpdateHistoryProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Usage.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Usage.PowerShell.cs new file mode 100644 index 000000000000..a63a8e820e4e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UsageNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit.CreateFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).CurrentValue = (int?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).CurrentValue, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Limit = (int?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Limit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UsageNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit.CreateFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).CurrentValue = (int?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).CurrentValue, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Limit = (int?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).Limit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Usage.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Usage.TypeConverter.cs new file mode 100644 index 000000000000..126ef498fa92 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Usage.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Usage.cs new file mode 100644 index 000000000000..a1a4e6689d63 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Describes Storage Resource Usage. + public partial class Usage : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsage, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageInternal.CurrentValue { get => this._currentValue; set { {_currentValue = value;} } } + + /// Internal Acessors for Limit + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal.Limit { get => this._limit; set { {_limit = value;} } } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageName Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.UsageName()); set { {_name = value;} } } + + /// Internal Acessors for NameLocalizedValue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal.NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)Name).LocalizedValue = value; } + + /// Internal Acessors for NameValue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal.NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)Name).Value = value; } + + /// Internal Acessors for Unit + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageName Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/Usage.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/Usage.json.cs new file mode 100644 index 000000000000..adc88bee4a12 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageListResult.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageListResult.PowerShell.cs new file mode 100644 index 000000000000..bebba8ce6909 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUsageListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageListResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageListResult.TypeConverter.cs new file mode 100644 index 000000000000..0a74af34f0e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageListResult.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageListResult.cs new file mode 100644 index 000000000000..06440e305993 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.IUsage) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsage[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageListResult.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageListResult.json.cs new file mode 100644 index 000000000000..b1c779f72c1b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsage) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.Usage.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageName.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageName.PowerShell.cs new file mode 100644 index 000000000000..a7a1653f14d8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUsageNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageName.TypeConverter.cs new file mode 100644 index 000000000000..942db2480a7c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageName ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageName.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageName.cs new file mode 100644 index 000000000000..6809292d31c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageName, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUsageNameInternal.LocalizedValue { get => this._localizedValue; set { {_localizedValue = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UsageName.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UsageName.json.cs new file mode 100644 index 000000000000..d5a3152c6749 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUsageName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUsageName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.PowerShell.cs new file mode 100644 index 000000000000..834c19ce0252 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.TypeConverter.cs new file mode 100644 index 000000000000..e7310d2ae94a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.cs new file mode 100644 index 000000000000..4ae83618075b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// UserAssignedIdentity for the resource. + public partial class UserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/UserAssignedIdentity.json.cs new file mode 100644 index 000000000000..6896ebaf09c9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IUserAssignedIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IUserAssignedIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.PowerShell.cs new file mode 100644 index 000000000000..f18904584c2c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId = (string) content.GetValueForProperty("VirtualNetworkResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId = (string) content.GetValueForProperty("VirtualNetworkResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRuleInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.TypeConverter.cs new file mode 100644 index 000000000000..492c195002b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IVirtualNetworkRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.cs new file mode 100644 index 000000000000..e691bb007608 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Virtual Network rule. + public partial class VirtualNetworkRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/VirtualNetworkRule.json.cs new file mode 100644 index 000000000000..92436a8eded7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api20230501/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.Api20230501 +{ + 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.Api20230501.IVirtualNetworkRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IVirtualNetworkRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.PowerShell.cs new file mode 100644 index 000000000000..43ff007fe604 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The resource management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial class ErrorAdditionalInfo + { + + /// + /// 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.Api50.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorAdditionalInfo(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.Api50.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorAdditionalInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorAdditionalInfo(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.Api50.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.AnyTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorAdditionalInfo(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.Api50.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.AnyTypeConverter.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.Api50.IErrorAdditionalInfo 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 management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial interface IErrorAdditionalInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.TypeConverter.cs new file mode 100644 index 000000000000..deb3f9f07355 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorAdditionalInfoTypeConverter : 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.Api50.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorAdditionalInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.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.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..375c3749ad74 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny _info; + + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Any()); } + + /// Internal Acessors for Info + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Any()); set { {_info = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type; + + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ErrorAdditionalInfo() + { + + } + } + /// The resource management error additional info. + public partial interface IErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info.", + SerializedName = @"info", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny Info { get; } + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The resource management error additional info. + internal partial interface IErrorAdditionalInfoInternal + + { + /// The additional info. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IAny Info { get; set; } + /// The additional info type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.json.cs new file mode 100644 index 000000000000..79463b4a23ed --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorAdditionalInfo.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + + /// + /// 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 ErrorAdditionalInfo(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;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Any.FromJson(__jsonInfo) : Info;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(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._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)) + { + AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.PowerShell.cs new file mode 100644 index 000000000000..854fcffd4e2c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial class ErrorDetail + { + + /// + /// 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.Api50.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorDetail(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.Api50.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorDetail(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.Api50.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorDetail(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.Api50.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfoTypeConverter.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.Api50.IErrorDetail 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 error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial interface IErrorDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.TypeConverter.cs new file mode 100644 index 000000000000..a5ea225e1748 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorDetailTypeConverter : 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.Api50.IErrorDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorDetail.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.DefaultTag/generated/api/Models/Api50/ErrorDetail.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.cs new file mode 100644 index 000000000000..1d4d430f8d6f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] _detail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Target { get => this._target; } + + /// Creates an new instance. + public ErrorDetail() + { + + } + } + /// The error detail. + public partial interface IErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The error detail. + internal partial interface IErrorDetailInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.json.cs new file mode 100644 index 000000000000..31e76fc3b952 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorDetail.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail + { + + /// + /// 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 ErrorDetail(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.Api50.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo 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.Api50.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ErrorDetail(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._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 ); + } + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + 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); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._additionalInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalInfo",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..b8dc7e99a070 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseAutoGeneratedTypeConverter))] + public partial class ErrorResponseAutoGenerated + { + + /// + /// 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.Api50.IErrorResponseAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseAutoGenerated(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.Api50.IErrorResponseAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseAutoGenerated(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseAutoGenerated(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.Api50.IErrorResponseAutoGeneratedInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponseAutoGenerated(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.Api50.IErrorResponseAutoGeneratedInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorAdditionalInfoTypeConverter.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.Api50.IErrorResponseAutoGenerated 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(); + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + [System.ComponentModel.TypeConverter(typeof(ErrorResponseAutoGeneratedTypeConverter))] + public partial interface IErrorResponseAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..5603fcee012b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseAutoGeneratedTypeConverter : 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.Api50.IErrorResponseAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseAutoGenerated.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.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.cs new file mode 100644 index 000000000000..68039a93ec18 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponseAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetail()); set => this._error = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGeneratedInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Target = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public ErrorResponseAutoGenerated() + { + + } + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + public partial interface IErrorResponseAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + internal partial interface IErrorResponseAutoGeneratedInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorDetail Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.json.cs new file mode 100644 index 000000000000..ffe70235302b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ErrorResponseAutoGenerated.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.Api50 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponseAutoGenerated + { + + /// + /// 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 ErrorResponseAutoGenerated(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.Api50.ErrorDetail.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IErrorResponseAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ErrorResponseAutoGenerated(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.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..773f9343eeb4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.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.Api50 +{ + 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(ProxyResourceAutoGeneratedTypeConverter))] + public partial class ProxyResourceAutoGenerated + { + + /// + /// 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.Api50.IProxyResourceAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResourceAutoGenerated(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.Api50.IProxyResourceAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResourceAutoGenerated(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.Api50.IProxyResourceAutoGenerated 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 ProxyResourceAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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 ProxyResourceAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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(ProxyResourceAutoGeneratedTypeConverter))] + public partial interface IProxyResourceAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..24c8db800e24 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceAutoGeneratedTypeConverter : 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.Api50.IProxyResourceAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IProxyResourceAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResourceAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResourceAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResourceAutoGenerated.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.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.cs new file mode 100644 index 000000000000..42a7d9493220 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.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.Api50 +{ + 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 ProxyResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IProxyResourceAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IProxyResourceAutoGeneratedInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = 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.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = 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.Api50.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; } + + /// Creates an new instance. + public ProxyResourceAutoGenerated() + { + + } + + /// 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(__resourceAutoGenerated), __resourceAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); + } + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + public partial interface IProxyResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated + { + + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + internal partial interface IProxyResourceAutoGeneratedInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.json.cs new file mode 100644 index 000000000000..1e47e552a99f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ProxyResourceAutoGenerated.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.Api50 +{ + 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 ProxyResourceAutoGenerated + { + + /// + /// 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.Api50.IProxyResourceAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IProxyResourceAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IProxyResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProxyResourceAutoGenerated(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 ProxyResourceAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.ResourceAutoGenerated(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; + } + __resourceAutoGenerated?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..0fa11cd100c4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.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.Api50 +{ + 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(ResourceAutoGeneratedTypeConverter))] + public partial class ResourceAutoGenerated + { + + /// + /// 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.Api50.IResourceAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceAutoGenerated(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.Api50.IResourceAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceAutoGenerated(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.Api50.IResourceAutoGenerated 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 ResourceAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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 ResourceAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal)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(); + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + [System.ComponentModel.TypeConverter(typeof(ResourceAutoGeneratedTypeConverter))] + public partial interface IResourceAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..fc84645ac8a7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.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.Api50 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceAutoGeneratedTypeConverter : 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.Api50.IResourceAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceAutoGenerated.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.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.cs new file mode 100644 index 000000000000..45f57b91d473 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.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.Api50 +{ + 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 ResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. E.g. "/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.Api50.IResourceAutoGeneratedInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGeneratedInternal.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData _systemData; + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [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)""); } + + /// 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 ResourceAutoGenerated() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. E.g. "/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. E.g. ""/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 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 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 IResourceAutoGeneratedInternal + + { + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + 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; } + /// + /// 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.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.json.cs new file mode 100644 index 000000000000..36f553f537a6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/Api50/ResourceAutoGenerated.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.Api50 +{ + 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 ResourceAutoGenerated + { + + /// + /// 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.Api50.IResourceAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api50.IResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ResourceAutoGenerated(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 ResourceAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_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 != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + 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.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..2696a641650f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.PowerShell.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + { + + /// + /// 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.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(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.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(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.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders 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 NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal)this).Location, 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 NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal)this).Location, 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(NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..5e2b7210aeac --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersTypeConverter : 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.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.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.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.cs b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..04e1426f2f8b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders() + { + + } + } + public partial interface INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..ddc37722c2bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders + { + + /// + /// 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.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.INetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(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 NetworkSecurityPerimeterConfigurationsReconcileAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + 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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..def41a1bc6ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.PowerShell.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersTypeConverter))] + public partial class StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + { + + /// + /// 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.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(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.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(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.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders 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 StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal)this).Location, 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 StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal)this).Location, 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(StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersTypeConverter))] + public partial interface IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..b7a88738c496 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersTypeConverter : 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.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.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.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..20fb79c00c34 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders() + { + + } + } + public partial interface IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..401443389fa2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders + { + + /// + /// 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.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(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 StorageAccountsCustomerInitiatedMigrationAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + 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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.PowerShell.cs new file mode 100644 index 000000000000..c9c45f93b657 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.PowerShell.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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("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("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("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("MigrationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).MigrationName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName?) content.GetValueForProperty("MigrationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).MigrationName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName.CreateFrom); + } + 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("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("NetworkSecurityPerimeterConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).NetworkSecurityPerimeterConfigurationName = (string) content.GetValueForProperty("NetworkSecurityPerimeterConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).NetworkSecurityPerimeterConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("StorageTaskAssignmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).StorageTaskAssignmentName = (string) content.GetValueForProperty("StorageTaskAssignmentName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).StorageTaskAssignmentName, 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("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("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("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("MigrationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).MigrationName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName?) content.GetValueForProperty("MigrationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).MigrationName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName.CreateFrom); + } + 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("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("NetworkSecurityPerimeterConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).NetworkSecurityPerimeterConfigurationName = (string) content.GetValueForProperty("NetworkSecurityPerimeterConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).NetworkSecurityPerimeterConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("StorageTaskAssignmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).StorageTaskAssignmentName = (string) content.GetValueForProperty("StorageTaskAssignmentName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).StorageTaskAssignmentName, 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.DefaultTag/generated/api/Models/StorageIdentity.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.TypeConverter.cs new file mode 100644 index 000000000000..1bdefb37a960 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Models/StorageIdentity.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.cs new file mode 100644 index 000000000000..51dfc1001e5d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName? _migrationName; + + /// The name of the Storage Account Migration. 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.MigrationName? MigrationName { get => this._migrationName; set => this._migrationName = value; } + + /// + /// Backing field for property. + /// + private string _networkSecurityPerimeterConfigurationName; + + /// The name for Network Security Perimeter configuration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NetworkSecurityPerimeterConfigurationName { get => this._networkSecurityPerimeterConfigurationName; set => this._networkSecurityPerimeterConfigurationName = 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 _storageTaskAssignmentName; + + /// + /// The name of the storage task assignment within the specified resource group. Storage task assignment 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 StorageTaskAssignmentName { get => this._storageTaskAssignmentName; set => this._storageTaskAssignmentName = 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; } + /// The name of the Storage Account Migration. It should always be 'default' + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage Account Migration. It should always be 'default'", + SerializedName = @"migrationName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName? MigrationName { get; set; } + /// The name for Network Security Perimeter configuration + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name for Network Security Perimeter configuration", + SerializedName = @"networkSecurityPerimeterConfigurationName", + PossibleTypes = new [] { typeof(string) })] + string NetworkSecurityPerimeterConfigurationName { 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 name of the storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + string StorageTaskAssignmentName { 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; } + /// The name of the Storage Account Migration. It should always be 'default' + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName? MigrationName { get; set; } + /// The name for Network Security Perimeter configuration + string NetworkSecurityPerimeterConfigurationName { 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 name of the storage task assignment within the specified resource group. Storage task assignment names must be between + /// 3 and 24 characters in length and use numbers and lower-case letters only. + /// + string StorageTaskAssignmentName { 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.DefaultTag/generated/api/Models/StorageIdentity.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.json.cs new file mode 100644 index 000000000000..ddaa6aeaf182 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageIdentity.json.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 +{ + 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; + } + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_accountName = If( json?.PropertyT("accountName"), out var __jsonAccountName) ? (string)__jsonAccountName : (string)AccountName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_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;} + {_migrationName = If( json?.PropertyT("migrationName"), out var __jsonMigrationName) ? (string)__jsonMigrationName : (string)MigrationName;} + {_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;} + {_tableServiceName = If( json?.PropertyT("tableServiceName"), out var __jsonTableServiceName) ? (string)__jsonTableServiceName : (string)TableServiceName;} + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_networkSecurityPerimeterConfigurationName = If( json?.PropertyT("networkSecurityPerimeterConfigurationName"), out var __jsonNetworkSecurityPerimeterConfigurationName) ? (string)__jsonNetworkSecurityPerimeterConfigurationName : (string)NetworkSecurityPerimeterConfigurationName;} + {_storageTaskAssignmentName = If( json?.PropertyT("storageTaskAssignmentName"), out var __jsonStorageTaskAssignmentName) ? (string)__jsonStorageTaskAssignmentName : (string)StorageTaskAssignmentName;} + {_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._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._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._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._migrationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._migrationName.ToString()) : null, "migrationName" ,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._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._networkSecurityPerimeterConfigurationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._networkSecurityPerimeterConfigurationName.ToString()) : null, "networkSecurityPerimeterConfigurationName" ,container.Add ); + AddIf( null != (((object)this._storageTaskAssignmentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._storageTaskAssignmentName.ToString()) : null, "storageTaskAssignmentName" ,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.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..2142140425de --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.PowerShell.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentsCreateAcceptedResponseHeadersTypeConverter))] + public partial class StorageTaskAssignmentsCreateAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsCreateAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentsCreateAcceptedResponseHeaders(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.IStorageTaskAssignmentsCreateAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentsCreateAcceptedResponseHeaders(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.IStorageTaskAssignmentsCreateAcceptedResponseHeaders 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 StorageTaskAssignmentsCreateAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal)this).Location, 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 StorageTaskAssignmentsCreateAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal)this).Location, 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(StorageTaskAssignmentsCreateAcceptedResponseHeadersTypeConverter))] + public partial interface IStorageTaskAssignmentsCreateAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..5b2c9d4768e1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentsCreateAcceptedResponseHeadersTypeConverter : 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.IStorageTaskAssignmentsCreateAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentsCreateAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsCreateAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsCreateAcceptedResponseHeaders.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.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..f8d1c2375051 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsCreateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public StorageTaskAssignmentsCreateAcceptedResponseHeaders() + { + + } + } + public partial interface IStorageTaskAssignmentsCreateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IStorageTaskAssignmentsCreateAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..73cc7106ce8f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsCreateAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsCreateAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsCreateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsCreateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentsCreateAcceptedResponseHeaders(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 StorageTaskAssignmentsCreateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + 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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..ca7c402c0bd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.PowerShell.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentsDeleteAcceptedResponseHeadersTypeConverter))] + public partial class StorageTaskAssignmentsDeleteAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentsDeleteAcceptedResponseHeaders(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.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentsDeleteAcceptedResponseHeaders(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.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders 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 StorageTaskAssignmentsDeleteAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal)this).Location, 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 StorageTaskAssignmentsDeleteAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal)this).Location, 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(StorageTaskAssignmentsDeleteAcceptedResponseHeadersTypeConverter))] + public partial interface IStorageTaskAssignmentsDeleteAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..c29c2decedbb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentsDeleteAcceptedResponseHeadersTypeConverter : 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.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentsDeleteAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsDeleteAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsDeleteAcceptedResponseHeaders.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.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..c2ece5bbf6f7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public StorageTaskAssignmentsDeleteAcceptedResponseHeaders() + { + + } + } + public partial interface IStorageTaskAssignmentsDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IStorageTaskAssignmentsDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..ec68481371c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsDeleteAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsDeleteAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentsDeleteAcceptedResponseHeaders(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 StorageTaskAssignmentsDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + 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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.PowerShell.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..8c51dc1a54dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.PowerShell.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 Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageTaskAssignmentsUpdateAcceptedResponseHeadersTypeConverter))] + public partial class StorageTaskAssignmentsUpdateAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageTaskAssignmentsUpdateAcceptedResponseHeaders(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.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageTaskAssignmentsUpdateAcceptedResponseHeaders(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.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders 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 StorageTaskAssignmentsUpdateAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal)this).Location, 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 StorageTaskAssignmentsUpdateAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal)this).Location, 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(StorageTaskAssignmentsUpdateAcceptedResponseHeadersTypeConverter))] + public partial interface IStorageTaskAssignmentsUpdateAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..71e1d0e3d22e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageTaskAssignmentsUpdateAcceptedResponseHeadersTypeConverter : 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.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageTaskAssignmentsUpdateAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsUpdateAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageTaskAssignmentsUpdateAcceptedResponseHeaders.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.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..df93a4dae538 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public StorageTaskAssignmentsUpdateAcceptedResponseHeaders() + { + + } + } + public partial interface IStorageTaskAssignmentsUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IStorageTaskAssignmentsUpdateAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.json.cs b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..9a622867ead0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Models/StorageTaskAssignmentsUpdateAcceptedResponseHeaders.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageTaskAssignmentsUpdateAcceptedResponseHeaders + { + + /// + /// 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.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageTaskAssignmentsUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageTaskAssignmentsUpdateAcceptedResponseHeaders(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 StorageTaskAssignmentsUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + 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; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/StorageManagementClient.cs b/swaggerci/storage.DefaultTag/generated/api/StorageManagementClient.cs new file mode 100644 index 000000000000..1f913a54c80f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/StorageManagementClient.cs @@ -0,0 +1,20576 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.ILeaseContainerRequest 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 = @"2023-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.Api20230501.ILeaseContainerRequest 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 = @"2023-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.Api20230501.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.Api20230501.ILeaseContainerRequest 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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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. + /// Optional, specifies the maximum number of encryption scopes that will be included in the list + /// response. + /// Optional. When specified, only encryption scope names starting with the filter will be listed. + /// Optional, when specified, will list encryption scopes with the specific state. Defaults to All + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude? 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 = @"2023-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) + + "&" + + (null == Maxpagesize ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize.ToString())) + + "&" + + (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.EncryptionScopesList_Call(request,onOk,eventListener,sender); + } + } + + /// Lists all the encryption scopes available under the specified storage account. + /// + /// Optional, specifies the maximum number of encryption scopes that will be included in the list + /// response. + /// Optional. When specified, only encryption scope names starting with the filter will be listed. + /// Optional, when specified, will list encryption scopes with the specific state. Defaults to All + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude? 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 = @"2023-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) + + "&" + + (null == Maxpagesize ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize.ToString())) + + "&" + + (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.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.Api20230501.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. + /// Optional, specifies the maximum number of encryption scopes that will be included in the list + /// response. + /// Optional. When specified, only encryption scope names starting with the filter will be listed. + /// Optional, when specified, will list encryption scopes with the specific state. Defaults to All + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude? 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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Maxpagesize),Maxpagesize,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Maxpagesize),Maxpagesize,5000); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Include),Include); + await eventListener.AssertEnum(nameof(Include),Include,@"All", @"Enabled", @"Disabled"); + } + } + + /// + /// 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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. Properties for NFSv3 enablement and + /// extended groups cannot be set with other properties. + /// + /// 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.Api20230501.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 = @"2023-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. Properties for NFSv3 enablement and + /// extended groups cannot be set with other properties. + /// + /// + /// 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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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. + /// Optional, specifies the maximum number of local users that will be included in the list response. + /// Optional. When specified, only local user names starting with the filter will be listed. + /// Optional, when specified, will list local users enabled for the specific protocol. Lists all users + /// by default. + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam? Include, 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 = @"2023-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) + + "&" + + (null == Maxpagesize ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize.ToString())) + + "&" + + (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.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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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. + /// + /// Optional, specifies the maximum number of local users that will be included in the list response. + /// Optional. When specified, only local user names starting with the filter will be listed. + /// Optional, when specified, will list local users enabled for the specific protocol. Lists all users + /// by default. + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam? Include, 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 = @"2023-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) + + "&" + + (null == Maxpagesize ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize.ToString())) + + "&" + + (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.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.Api20230501.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.Api20230501.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. + /// Optional, specifies the maximum number of local users that will be included in the list response. + /// Optional. When specified, only local user names starting with the filter will be listed. + /// Optional, when specified, will list local users enabled for the specific protocol. Lists all users + /// by default. + /// 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, int? Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam? 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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Maxpagesize),Maxpagesize,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Maxpagesize),Maxpagesize,5000); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Include),Include); + await eventListener.AssertEnum(nameof(Include),Include,@"nfsv3"); + } + } + + /// 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets effective NetworkSecurityPerimeterConfiguration for association + /// The ID of the target subscription. + /// 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 for Network Security Perimeter configuration + /// 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 NetworkSecurityPerimeterConfigurationsGet(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, 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 = @"2023-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) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(networkSecurityPerimeterConfigurationName) + + "?" + + "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.NetworkSecurityPerimeterConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets effective NetworkSecurityPerimeterConfiguration for association + /// + /// 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 NetworkSecurityPerimeterConfigurationsGetViaIdentity(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 = @"2023-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/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", 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}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var networkSecurityPerimeterConfigurationName = _match.Groups["networkSecurityPerimeterConfigurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/networkSecurityPerimeterConfigurations/" + + networkSecurityPerimeterConfigurationName + + "?" + + "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.NetworkSecurityPerimeterConfigurationsGet_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 NetworkSecurityPerimeterConfigurationsGet_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.Api20230501.NetworkSecurityPerimeterConfiguration.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.Api50.ErrorResponseAutoGenerated.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. + /// 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 for Network Security Perimeter configuration + /// 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 NetworkSecurityPerimeterConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, 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(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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(networkSecurityPerimeterConfigurationName),networkSecurityPerimeterConfigurationName); + await eventListener.AssertRegEx(nameof(networkSecurityPerimeterConfigurationName),networkSecurityPerimeterConfigurationName,@"^.*$"); + } + } + + /// + /// Gets list of effective NetworkSecurityPerimeterConfiguration for storage account + /// + /// The ID of the target subscription. + /// 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. + /// 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 NetworkSecurityPerimeterConfigurationsList(string subscriptionId, string resourceGroupName, string accountName, 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 = @"2023-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) + + "/networkSecurityPerimeterConfigurations" + + "?" + + "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.NetworkSecurityPerimeterConfigurationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets list of effective NetworkSecurityPerimeterConfiguration for 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 NetworkSecurityPerimeterConfigurationsListViaIdentity(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 = @"2023-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/(?[^/]+)/networkSecurityPerimeterConfigurations$", 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}/networkSecurityPerimeterConfigurations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/networkSecurityPerimeterConfigurations" + + "?" + + "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.NetworkSecurityPerimeterConfigurationsList_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 NetworkSecurityPerimeterConfigurationsList_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.Api20230501.NetworkSecurityPerimeterConfigurationList.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.Api50.ErrorResponseAutoGenerated.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. + /// 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. + /// 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 NetworkSecurityPerimeterConfigurationsList_Validate(string subscriptionId, string resourceGroupName, string accountName, 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(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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + } + } + + /// Refreshes any information about the association. + /// The ID of the target subscription. + /// 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 for Network Security Perimeter configuration + /// 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 NetworkSecurityPerimeterConfigurationsReconcile(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, 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 = @"2023-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) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(networkSecurityPerimeterConfigurationName) + + "/reconcile" + + "?" + + "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.NetworkSecurityPerimeterConfigurationsReconcile_Call(request,onDefault,eventListener,sender); + } + } + + /// Refreshes any information about the association. + /// + /// 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 NetworkSecurityPerimeterConfigurationsReconcileViaIdentity(global::System.String viaIdentity, 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 = @"2023-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/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)/reconcile$", 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}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var networkSecurityPerimeterConfigurationName = _match.Groups["networkSecurityPerimeterConfigurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/networkSecurityPerimeterConfigurations/" + + networkSecurityPerimeterConfigurationName + + "/reconcile" + + "?" + + "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.NetworkSecurityPerimeterConfigurationsReconcile_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// 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 NetworkSecurityPerimeterConfigurationsReconcile_Call(global::System.Net.Http.HttpRequestMessage request, 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 ) + { + 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.Api50.ErrorResponseAutoGenerated.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. + /// 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 for Network Security Perimeter configuration + /// 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 NetworkSecurityPerimeterConfigurationsReconcile_Validate(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, 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(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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(networkSecurityPerimeterConfigurationName),networkSecurityPerimeterConfigurationName); + await eventListener.AssertRegEx(nameof(networkSecurityPerimeterConfigurationName),networkSecurityPerimeterConfigurationName,@"^.*$"); + } + } + + /// 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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); + } + } + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// 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 request parameters required to perform storage account migration. + /// 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 StorageAccountsCustomerInitiatedMigration(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration 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 = @"2023-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) + + "/startAccountMigration" + + "?" + + "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.StorageAccountsCustomerInitiatedMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// + /// The request parameters required to perform storage account migration. + /// 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 StorageAccountsCustomerInitiatedMigrationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration 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 = @"2023-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/(?[^/]+)/startAccountMigration$", 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}/startAccountMigration'"); + } + + // 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 + + "/startAccountMigration" + + "?" + + "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.StorageAccountsCustomerInitiatedMigration_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 StorageAccountsCustomerInitiatedMigration_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.Api50.ErrorResponseAutoGenerated.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 request parameters required to perform storage account migration. + /// 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 StorageAccountsCustomerInitiatedMigration_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration 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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for any + /// reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS accounts. The + /// secondary cluster will become primary after failover and the account is converted to LRS. In the case of a Planned Failover, + /// the primary and secondary clusters are swapped after failover and the account remains geo-replicated. Failover should + /// continue to be used in the event of availability issues as Planned failover is only available while the primary and secondary + /// endpoints are available. The primary use case of a Planned Failover is disaster recovery testing drills. This type of + /// failover is invoked by setting FailoverType parameter to 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance + /// + /// 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 parameter is set to 'Planned' to indicate whether a Planned failover is requested. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType? failoverType, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-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) + + "&" + + (string.IsNullOrEmpty(failoverType) ? global::System.String.Empty : "failoverType=" + global::System.Uri.EscapeDataString(failoverType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$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); + } + } + + /// + /// A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for any + /// reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS accounts. The + /// secondary cluster will become primary after failover and the account is converted to LRS. In the case of a Planned Failover, + /// the primary and secondary clusters are swapped after failover and the account remains geo-replicated. Failover should + /// continue to be used in the event of availability issues as Planned failover is only available while the primary and secondary + /// endpoints are available. The primary use case of a Planned Failover is disaster recovery testing drills. This type of + /// failover is invoked by setting FailoverType parameter to 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance + /// + /// + /// The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType? failoverType, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-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) + + "&" + + (string.IsNullOrEmpty(failoverType) ? global::System.String.Empty : "failoverType=" + global::System.Uri.EscapeDataString(failoverType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$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. + /// The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + /// 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.Support.FailoverType? failoverType, 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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(failoverType),failoverType); + await eventListener.AssertEnum(nameof(failoverType),failoverType,@"Planned"); + } + } + + /// Gets the status of the ongoing migration 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. + /// 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 StorageAccountsGetCustomerInitiatedMigration(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 migrationName = @"default"; + var apiVersion = @"2023-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) + + "/accountMigrations/" + + global::System.Uri.EscapeDataString(migrationName) + + "?" + + "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.StorageAccountsGetCustomerInitiatedMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the status of the ongoing migration for 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 StorageAccountsGetCustomerInitiatedMigrationViaIdentity(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 = @"2023-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/(?[^/]+)/accountMigrations/(?[^/]+)$", 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}/accountMigrations/{migrationName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var migrationName = _match.Groups["migrationName"].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 + + "/accountMigrations/" + + migrationName + + "?" + + "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.StorageAccountsGetCustomerInitiatedMigration_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 StorageAccountsGetCustomerInitiatedMigration_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.Api20230501.StorageAccountMigration.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.Api50.ErrorResponseAutoGenerated.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 StorageAccountsGetCustomerInitiatedMigration_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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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.Api20230501.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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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); + } + } + + /// Fetch the report summary of a single storage task assignment's instances + /// The ID of the target subscription. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentInstancesReportList(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, 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 = @"2023-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) + + "/storageTaskAssignments/" + + global::System.Uri.EscapeDataString(storageTaskAssignmentName) + + "/reports" + + "?" + + (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)) + + "&" + + "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.StorageTaskAssignmentInstancesReportList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetch the report summary of a single storage task assignment's instances + /// + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentInstancesReportListViaIdentity(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 = @"2023-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/(?[^/]+)/storageTaskAssignments/(?[^/]+)/reports$", 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}/storageTaskAssignments/{storageTaskAssignmentName}/reports'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var storageTaskAssignmentName = _match.Groups["storageTaskAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments/" + + storageTaskAssignmentName + + "/reports" + + "?" + + (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)) + + "&" + + "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.StorageTaskAssignmentInstancesReportList_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 StorageTaskAssignmentInstancesReportList_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.Api20230501.StorageTaskReportSummary.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentInstancesReportList_Validate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, string Maxpagesize, string Filter, 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(storageTaskAssignmentName),storageTaskAssignmentName); + await eventListener.AssertMinimumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,3); + await eventListener.AssertMaximumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,24); + await eventListener.AssertRegEx(nameof(storageTaskAssignmentName),storageTaskAssignmentName,@"^[a-z0-9]{3,24}$"); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage task assignment + /// is already created and a subsequent create request is issued with different properties, the storage task assignment properties + /// will be updated. If a storage task assignment is already created and a subsequent create or update request is issued with + /// the exact same set of properties, the request will succeed. + /// + /// The ID of the target subscription. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The parameters to create a Storage Task Assignment. + /// 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 StorageTaskAssignmentsCreate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment 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 = @"2023-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) + + "/storageTaskAssignments/" + + global::System.Uri.EscapeDataString(storageTaskAssignmentName) + + "?" + + "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.StorageTaskAssignmentsCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage task assignment + /// is already created and a subsequent create request is issued with different properties, the storage task assignment properties + /// will be updated. If a storage task assignment 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 create a Storage Task Assignment. + /// 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 StorageTaskAssignmentsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment 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 = @"2023-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/(?[^/]+)/storageTaskAssignments/(?[^/]+)$", 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}/storageTaskAssignments/{storageTaskAssignmentName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var storageTaskAssignmentName = _match.Groups["storageTaskAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments/" + + storageTaskAssignmentName + + "?" + + "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.StorageTaskAssignmentsCreate_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 StorageTaskAssignmentsCreate_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; } + // 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.Api20230501.StorageTaskAssignment.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The parameters to create a Storage Task Assignment. + /// 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 StorageTaskAssignmentsCreate_Validate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(storageTaskAssignmentName),storageTaskAssignmentName); + await eventListener.AssertMinimumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,3); + await eventListener.AssertMaximumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,24); + await eventListener.AssertRegEx(nameof(storageTaskAssignmentName),storageTaskAssignmentName,@"^[a-z0-9]{3,24}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the storage task assignment sub-resource + /// The ID of the target subscription. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment 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 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 StorageTaskAssignmentsDelete(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, 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 = @"2023-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) + + "/storageTaskAssignments/" + + global::System.Uri.EscapeDataString(storageTaskAssignmentName) + + "?" + + "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.StorageTaskAssignmentsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the storage task assignment sub-resource + /// + /// 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 StorageTaskAssignmentsDeleteViaIdentity(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 = @"2023-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/(?[^/]+)/storageTaskAssignments/(?[^/]+)$", 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}/storageTaskAssignments/{storageTaskAssignmentName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var storageTaskAssignmentName = _match.Groups["storageTaskAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments/" + + storageTaskAssignmentName + + "?" + + "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.StorageTaskAssignmentsDelete_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 StorageTaskAssignmentsDelete_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; } + // 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.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment 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 StorageTaskAssignmentsDelete_Validate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(storageTaskAssignmentName),storageTaskAssignmentName); + await eventListener.AssertMinimumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,3); + await eventListener.AssertMaximumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,24); + await eventListener.AssertRegEx(nameof(storageTaskAssignmentName),storageTaskAssignmentName,@"^[a-z0-9]{3,24}$"); + } + } + + /// Get the storage task assignment properties + /// The ID of the target subscription. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment 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). + /// 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 StorageTaskAssignmentsGet(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, 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 = @"2023-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) + + "/storageTaskAssignments/" + + global::System.Uri.EscapeDataString(storageTaskAssignmentName) + + "?" + + "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.StorageTaskAssignmentsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the storage task assignment 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 StorageTaskAssignmentsGetViaIdentity(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 = @"2023-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/(?[^/]+)/storageTaskAssignments/(?[^/]+)$", 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}/storageTaskAssignments/{storageTaskAssignmentName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var storageTaskAssignmentName = _match.Groups["storageTaskAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments/" + + storageTaskAssignmentName + + "?" + + "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.StorageTaskAssignmentsGet_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 StorageTaskAssignmentsGet_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.Api20230501.StorageTaskAssignment.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment 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 StorageTaskAssignmentsGet_Validate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(storageTaskAssignmentName),storageTaskAssignmentName); + await eventListener.AssertMinimumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,3); + await eventListener.AssertMaximumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,24); + await eventListener.AssertRegEx(nameof(storageTaskAssignmentName),storageTaskAssignmentName,@"^[a-z0-9]{3,24}$"); + } + } + + /// + /// Fetch the report summary of all the storage task assignments and instances in an account + /// + /// The ID of the target subscription. + /// The name of the resource group. 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. + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentsInstancesReportList(string subscriptionId, string resourceGroupName, string accountName, 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 = @"2023-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) + + "/reports" + + "?" + + (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)) + + "&" + + "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.StorageTaskAssignmentsInstancesReportList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Fetch the report summary of all the storage task assignments and instances in an account + /// + /// + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentsInstancesReportListViaIdentity(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 = @"2023-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/(?[^/]+)/reports$", 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}/reports'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/reports" + + "?" + + (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)) + + "&" + + "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.StorageTaskAssignmentsInstancesReportList_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 StorageTaskAssignmentsInstancesReportList_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.Api20230501.StorageTaskReportSummary.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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. + /// Optional, specifies the maximum number of storage task assignment instances to be included in + /// the list response. + /// Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter + /// Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// 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 StorageTaskAssignmentsInstancesReportList_Validate(string subscriptionId, string resourceGroupName, string accountName, string Maxpagesize, string Filter, 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the storage task assignments in an account + /// The ID of the target subscription. + /// The name of the resource group. 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. + /// Optional, specifies the maximum number of storage task assignment Ids to be included in the + /// list response. + /// 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 StorageTaskAssignmentsList(string subscriptionId, string resourceGroupName, string accountName, string Maxpagesize, 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 = @"2023-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) + + "/storageTaskAssignments" + + "?" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + "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.StorageTaskAssignmentsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the storage task assignments in an account + /// + /// Optional, specifies the maximum number of storage task assignment Ids to be included in the + /// list response. + /// 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 StorageTaskAssignmentsListViaIdentity(global::System.String viaIdentity, string Maxpagesize, 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 = @"2023-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/(?[^/]+)/storageTaskAssignments$", 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}/storageTaskAssignments'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments" + + "?" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + "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.StorageTaskAssignmentsList_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 StorageTaskAssignmentsList_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.Api20230501.StorageTaskAssignmentsList.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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. + /// Optional, specifies the maximum number of storage task assignment Ids to be included in the + /// list response. + /// 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 StorageTaskAssignmentsList_Validate(string subscriptionId, string resourceGroupName, string accountName, string Maxpagesize, 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + } + } + + /// Update storage task assignment properties + /// The ID of the target subscription. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The parameters to update a Storage Task Assignment. + /// 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 StorageTaskAssignmentsUpdate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters 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 = @"2023-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) + + "/storageTaskAssignments/" + + global::System.Uri.EscapeDataString(storageTaskAssignmentName) + + "?" + + "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.StorageTaskAssignmentsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update storage task assignment properties + /// + /// The parameters to update a Storage Task Assignment. + /// 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 StorageTaskAssignmentsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters 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 = @"2023-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/(?[^/]+)/storageTaskAssignments/(?[^/]+)$", 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}/storageTaskAssignments/{storageTaskAssignmentName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var storageTaskAssignmentName = _match.Groups["storageTaskAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/storageTaskAssignments/" + + storageTaskAssignmentName + + "?" + + "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.StorageTaskAssignmentsUpdate_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 StorageTaskAssignmentsUpdate_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; } + // 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.Api20230501.StorageTaskAssignment.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.Api50.ErrorResponseAutoGenerated.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. + /// The name of the resource group. 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 storage task assignment within the specified resource group. Storage + /// task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The parameters to update a Storage Task Assignment. + /// 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 StorageTaskAssignmentsUpdate_Validate(string subscriptionId, string resourceGroupName, string accountName, string storageTaskAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters 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(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + await eventListener.AssertNotNull(nameof(storageTaskAssignmentName),storageTaskAssignmentName); + await eventListener.AssertMinimumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,3); + await eventListener.AssertMaximumLength(nameof(storageTaskAssignmentName),storageTaskAssignmentName,24); + await eventListener.AssertRegEx(nameof(storageTaskAssignmentName),storageTaskAssignmentName,@"^[a-z0-9]{3,24}$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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.Api20230501.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 = @"2023-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.Api20230501.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 = @"2023-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.Api20230501.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.Api20230501.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.Api20230501.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.AssertRegEx(nameof(accountName),accountName,@"^[a-z0-9]+$"); + 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 = @"2023-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 = @"2023-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.Api20230501.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.DefaultTag/generated/api/Support/AccessTier.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.Completer.cs new file mode 100644 index 000000000000..1cdd9a66d711 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.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 +{ + + /// + /// 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cold".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cold'", "Cold", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cold"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.TypeConverter.cs new file mode 100644 index 000000000000..6fa90dfda9d4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccessTier.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.cs new file mode 100644 index 000000000000..e07d62653e2c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/AccessTier.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 +{ + + /// + /// 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 Cold = @"Cold"; + + 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.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.Completer.cs new file mode 100644 index 000000000000..f56962640571 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.TypeConverter.cs new file mode 100644 index 000000000000..858dc7277f50 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountImmutabilityPolicyState.cs new file mode 100644 index 000000000000..4b3e3c964a25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountStatus.Completer.cs new file mode 100644 index 000000000000..aaac5555635a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountStatus.TypeConverter.cs new file mode 100644 index 000000000000..605f98597259 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountStatus.cs new file mode 100644 index 000000000000..b274d83f370f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountType.Completer.cs new file mode 100644 index 000000000000..5834378d93ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountType.TypeConverter.cs new file mode 100644 index 000000000000..3eec2b03e882 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AccountType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AccountType.cs new file mode 100644 index 000000000000..891868a5d428 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Action.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Action.Completer.cs new file mode 100644 index 000000000000..9309e8b4172d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Action.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Action.TypeConverter.cs new file mode 100644 index 000000000000..9de35863e06b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Action.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Action.cs new file mode 100644 index 000000000000..cd474a8f8d52 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AllowedCopyScope.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedCopyScope.Completer.cs new file mode 100644 index 000000000000..142150f90219 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AllowedCopyScope.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedCopyScope.TypeConverter.cs new file mode 100644 index 000000000000..c295c8ea6986 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AllowedCopyScope.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedCopyScope.cs new file mode 100644 index 000000000000..79482631a881 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AllowedMethods.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.Completer.cs new file mode 100644 index 000000000000..2566e80f8fd1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.Completer.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.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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CONNECT".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CONNECT'", "CONNECT", global::System.Management.Automation.CompletionResultType.ParameterValue, "CONNECT"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TRACE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TRACE'", "TRACE", global::System.Management.Automation.CompletionResultType.ParameterValue, "TRACE"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.TypeConverter.cs new file mode 100644 index 000000000000..3e4e31bd0f4e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/AllowedMethods.cs b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.cs new file mode 100644 index 000000000000..9bc335d94cd7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/AllowedMethods.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 +{ + + public partial struct AllowedMethods : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Connect = @"CONNECT"; + + 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"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Trace = @"TRACE"; + + /// 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.DefaultTag/generated/api/Support/BlobInventoryPolicyName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobInventoryPolicyName.Completer.cs new file mode 100644 index 000000000000..696cc2ff7da1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobInventoryPolicyName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobInventoryPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..4c4035955bbe --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobInventoryPolicyName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobInventoryPolicyName.cs new file mode 100644 index 000000000000..30264d08c97c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.Completer.cs new file mode 100644 index 000000000000..8675b4b731d4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.TypeConverter.cs new file mode 100644 index 000000000000..a93841807a11 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobRestoreProgressStatus.cs new file mode 100644 index 000000000000..63e52843659c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobServicesName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobServicesName.Completer.cs new file mode 100644 index 000000000000..635c63d98528 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobServicesName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobServicesName.TypeConverter.cs new file mode 100644 index 000000000000..0e28b1d738ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/BlobServicesName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/BlobServicesName.cs new file mode 100644 index 000000000000..a41189d66a57 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Bypass.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Bypass.Completer.cs new file mode 100644 index 000000000000..2c0447b0769a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Bypass.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Bypass.TypeConverter.cs new file mode 100644 index 000000000000..b5383a082a9b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Bypass.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Bypass.cs new file mode 100644 index 000000000000..707fbb5330a2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..4f25f724b0a5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..57ab1f2c3c3a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/CreatedByType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..8471f5137372 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultAction.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultAction.Completer.cs new file mode 100644 index 000000000000..83bb7a6abd00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultAction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultAction.TypeConverter.cs new file mode 100644 index 000000000000..892b71682232 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultAction.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultAction.cs new file mode 100644 index 000000000000..cc076ba0acb5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultSharePermission.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultSharePermission.Completer.cs new file mode 100644 index 000000000000..de34ac39e98f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultSharePermission.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultSharePermission.TypeConverter.cs new file mode 100644 index 000000000000..5589dafa17a9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DefaultSharePermission.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DefaultSharePermission.cs new file mode 100644 index 000000000000..0b0c24d66d29 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DirectoryServiceOptions.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DirectoryServiceOptions.Completer.cs new file mode 100644 index 000000000000..17a4d1398c4d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DirectoryServiceOptions.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DirectoryServiceOptions.TypeConverter.cs new file mode 100644 index 000000000000..0808fc070dde --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DirectoryServiceOptions.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DirectoryServiceOptions.cs new file mode 100644 index 000000000000..57673bca9548 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DnsEndpointType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DnsEndpointType.Completer.cs new file mode 100644 index 000000000000..919258456e63 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DnsEndpointType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DnsEndpointType.TypeConverter.cs new file mode 100644 index 000000000000..78c5cb06cdd8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/DnsEndpointType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/DnsEndpointType.cs new file mode 100644 index 000000000000..90e379fa982c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EnabledProtocols.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EnabledProtocols.Completer.cs new file mode 100644 index 000000000000..9956d84563d5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EnabledProtocols.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EnabledProtocols.TypeConverter.cs new file mode 100644 index 000000000000..77da22c4f2cd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EnabledProtocols.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EnabledProtocols.cs new file mode 100644 index 000000000000..14846c0a26aa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeSource.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeSource.Completer.cs new file mode 100644 index 000000000000..139b3f6bbed0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeSource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeSource.TypeConverter.cs new file mode 100644 index 000000000000..e7ebbe5e83e1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeSource.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeSource.cs new file mode 100644 index 000000000000..d370f48455e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeState.Completer.cs new file mode 100644 index 000000000000..1f158cee86ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeState.TypeConverter.cs new file mode 100644 index 000000000000..16606ad3ff77 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/EncryptionScopeState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/EncryptionScopeState.cs new file mode 100644 index 000000000000..b7d40fadf4c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ExpirationAction.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.Completer.cs new file mode 100644 index 000000000000..93629b42e9d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.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 SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationActionTypeConverter))] + public partial struct ExpirationAction : + 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) || "Log".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Log'", "Log", global::System.Management.Automation.CompletionResultType.ParameterValue, "Log"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Block".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Block'", "Block", global::System.Management.Automation.CompletionResultType.ParameterValue, "Block"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.TypeConverter.cs new file mode 100644 index 000000000000..55aefbc8b618 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.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 SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + public partial class ExpirationActionTypeConverter : + 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) => ExpirationAction.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.DefaultTag/generated/api/Support/ExpirationAction.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.cs new file mode 100644 index 000000000000..193a729eee21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ExpirationAction.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 SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + public partial struct ExpirationAction : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction Block = @"Block"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ExpirationAction + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ExpirationAction(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ExpirationAction + /// 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.ExpirationAction e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ExpirationAction (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 ExpirationAction && Equals((ExpirationAction)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ExpirationAction(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ExpirationAction + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ExpirationAction + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ExpirationAction + /// the value to convert to an instance of . + + public static implicit operator ExpirationAction(string value) + { + return new ExpirationAction(value); + } + + /// Implicit operator to convert ExpirationAction to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction e) + { + return e._value; + } + + /// Overriding != operator for enum ExpirationAction + /// 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.ExpirationAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ExpirationAction + /// 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.ExpirationAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ExtendedLocationTypes.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExtendedLocationTypes.Completer.cs new file mode 100644 index 000000000000..a10c2d548333 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs new file mode 100644 index 000000000000..5b2aaf349545 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ExtendedLocationTypes.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ExtendedLocationTypes.cs new file mode 100644 index 000000000000..3e3373430fda --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/FailoverType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.Completer.cs new file mode 100644 index 000000000000..b2a636aea6e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.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 FailoverType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverTypeTypeConverter))] + public partial struct FailoverType : + 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) || "Planned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Planned'", "Planned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Planned"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.TypeConverter.cs new file mode 100644 index 000000000000..69b148472399 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.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 FailoverType. + public partial class FailoverTypeTypeConverter : + 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) => FailoverType.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.DefaultTag/generated/api/Support/FailoverType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.cs new file mode 100644 index 000000000000..3b755a85b29b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/FailoverType.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 FailoverType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType Planned = @"Planned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to FailoverType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new FailoverType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type FailoverType + /// 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.FailoverType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type FailoverType (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 FailoverType && Equals((FailoverType)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private FailoverType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum FailoverType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for FailoverType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to FailoverType + /// the value to convert to an instance of . + + public static implicit operator FailoverType(string value) + { + return new FailoverType(value); + } + + /// Implicit operator to convert FailoverType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType e) + { + return e._value; + } + + /// Overriding != operator for enum FailoverType + /// 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.FailoverType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum FailoverType + /// 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.FailoverType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FailoverType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/FileServicesName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FileServicesName.Completer.cs new file mode 100644 index 000000000000..20bd4cf90f64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/FileServicesName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FileServicesName.TypeConverter.cs new file mode 100644 index 000000000000..78649607d093 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/FileServicesName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/FileServicesName.cs new file mode 100644 index 000000000000..0f52e781f306 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Format.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Format.Completer.cs new file mode 100644 index 000000000000..eb0cec980c89 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Format.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Format.TypeConverter.cs new file mode 100644 index 000000000000..92e555659848 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Format.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Format.cs new file mode 100644 index 000000000000..36bf9763b0b2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/GeoReplicationStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/GeoReplicationStatus.Completer.cs new file mode 100644 index 000000000000..ab3a081fa745 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/GeoReplicationStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/GeoReplicationStatus.TypeConverter.cs new file mode 100644 index 000000000000..d1fa32249a6d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/GeoReplicationStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/GeoReplicationStatus.cs new file mode 100644 index 000000000000..3b668806ca49 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/HttpProtocol.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/HttpProtocol.Completer.cs new file mode 100644 index 000000000000..c22950e5cb34 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/HttpProtocol.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/HttpProtocol.TypeConverter.cs new file mode 100644 index 000000000000..2db4b8604a78 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/HttpProtocol.cs b/swaggerci/storage.DefaultTag/generated/api/Support/HttpProtocol.cs new file mode 100644 index 000000000000..528619d42815 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/IdentityType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IdentityType.Completer.cs new file mode 100644 index 000000000000..917a1d8041e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/IdentityType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IdentityType.TypeConverter.cs new file mode 100644 index 000000000000..d3abf6aca750 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/IdentityType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IdentityType.cs new file mode 100644 index 000000000000..41f93c7d9279 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyName.Completer.cs new file mode 100644 index 000000000000..cc206c5e6717 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..c07e7fcf0acb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyName.cs new file mode 100644 index 000000000000..1d8e4247cd49 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyState.Completer.cs new file mode 100644 index 000000000000..50c1036ba899 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyState.TypeConverter.cs new file mode 100644 index 000000000000..2c9c1b2d5997 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyState.cs new file mode 100644 index 000000000000..39d275d5ff93 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.Completer.cs new file mode 100644 index 000000000000..5077d1411f30 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.TypeConverter.cs new file mode 100644 index 000000000000..55694b9d60f7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ImmutabilityPolicyUpdateType.cs new file mode 100644 index 000000000000..0ab22ea2d0fa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/IntervalUnit.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.Completer.cs new file mode 100644 index 000000000000..1d7fca73a523 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.Completer.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 +{ + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnitTypeConverter))] + public partial struct IntervalUnit : + 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) || "Days".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Days'", "Days", global::System.Management.Automation.CompletionResultType.ParameterValue, "Days"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.TypeConverter.cs new file mode 100644 index 000000000000..8652175cd57b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.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 +{ + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + public partial class IntervalUnitTypeConverter : + 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) => IntervalUnit.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.DefaultTag/generated/api/Support/IntervalUnit.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.cs new file mode 100644 index 000000000000..570c1b470183 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IntervalUnit.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.Support +{ + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + public partial struct IntervalUnit : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit Days = @"Days"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IntervalUnit + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IntervalUnit(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IntervalUnit + /// 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.IntervalUnit e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IntervalUnit (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 IntervalUnit && Equals((IntervalUnit)obj); + } + + /// Returns hashCode for enum IntervalUnit + /// 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 IntervalUnit(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IntervalUnit + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IntervalUnit + /// the value to convert to an instance of . + + public static implicit operator IntervalUnit(string value) + { + return new IntervalUnit(value); + } + + /// Implicit operator to convert IntervalUnit to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit e) + { + return e._value; + } + + /// Overriding != operator for enum IntervalUnit + /// 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.IntervalUnit e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IntervalUnit + /// 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.IntervalUnit e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.Completer.cs new file mode 100644 index 000000000000..27229ce9f750 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.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 +{ + + /// Type of issue + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueTypeTypeConverter))] + public partial struct IssueType : + 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) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfigurationPropagationFailure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConfigurationPropagationFailure'", "ConfigurationPropagationFailure", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfigurationPropagationFailure"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.TypeConverter.cs new file mode 100644 index 000000000000..fa697fc12056 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.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 +{ + + /// Type of issue + public partial class IssueTypeTypeConverter : + 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) => IssueType.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.DefaultTag/generated/api/Support/IssueType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.cs new file mode 100644 index 000000000000..9baeb3609aa5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/IssueType.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 +{ + + /// Type of issue + public partial struct IssueType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType ConfigurationPropagationFailure = @"ConfigurationPropagationFailure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IssueType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IssueType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IssueType + /// 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.IssueType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IssueType (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 IssueType && Equals((IssueType)obj); + } + + /// Returns hashCode for enum IssueType + /// 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 IssueType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IssueType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IssueType + /// the value to convert to an instance of . + + public static implicit operator IssueType(string value) + { + return new IssueType(value); + } + + /// Implicit operator to convert IssueType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType e) + { + return e._value; + } + + /// Overriding != operator for enum IssueType + /// 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.IssueType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IssueType + /// 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.IssueType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IssueType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/KeyPermission.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyPermission.Completer.cs new file mode 100644 index 000000000000..aac16fe4893a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeyPermission.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyPermission.TypeConverter.cs new file mode 100644 index 000000000000..dc4cb58a1bfc --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeyPermission.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyPermission.cs new file mode 100644 index 000000000000..985ccc398672 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeySource.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeySource.Completer.cs new file mode 100644 index 000000000000..27e2e4803f09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeySource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeySource.TypeConverter.cs new file mode 100644 index 000000000000..b710a0c33ac1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeySource.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeySource.cs new file mode 100644 index 000000000000..c3abb289705b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeyType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyType.Completer.cs new file mode 100644 index 000000000000..1d8c69006076 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeyType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyType.TypeConverter.cs new file mode 100644 index 000000000000..c64167bfcd8e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/KeyType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/KeyType.cs new file mode 100644 index 000000000000..aa51d819b588 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Kind.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Kind.Completer.cs new file mode 100644 index 000000000000..8c8a0dde7670 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Kind.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Kind.TypeConverter.cs new file mode 100644 index 000000000000..655ecf18eb67 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Kind.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Kind.cs new file mode 100644 index 000000000000..62ad68eeb434 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LargeFileSharesState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LargeFileSharesState.Completer.cs new file mode 100644 index 000000000000..57bd13aabda2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LargeFileSharesState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LargeFileSharesState.TypeConverter.cs new file mode 100644 index 000000000000..c68259b22719 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LargeFileSharesState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LargeFileSharesState.cs new file mode 100644 index 000000000000..6eca0875bdb8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseContainerRequestAction.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.Completer.cs new file mode 100644 index 000000000000..302bd9afde64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.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.LeaseContainerRequestActionTypeConverter))] + public partial struct LeaseContainerRequestAction : + 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.DefaultTag/generated/api/Support/LeaseContainerRequestAction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.TypeConverter.cs new file mode 100644 index 000000000000..0c2ffa9d8b03 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.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 LeaseContainerRequestActionTypeConverter : + 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) => LeaseContainerRequestAction.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.DefaultTag/generated/api/Support/LeaseContainerRequestAction.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.cs new file mode 100644 index 000000000000..946b8f22be96 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseContainerRequestAction.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.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + public partial struct LeaseContainerRequestAction : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction Acquire = @"Acquire"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction Break = @"Break"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction Change = @"Change"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction Release = @"Release"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction Renew = @"Renew"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseContainerRequestAction + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseContainerRequestAction(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseContainerRequestAction + /// 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.LeaseContainerRequestAction e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseContainerRequestAction (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 LeaseContainerRequestAction && Equals((LeaseContainerRequestAction)obj); + } + + /// Returns hashCode for enum LeaseContainerRequestAction + /// 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 LeaseContainerRequestAction(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseContainerRequestAction + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseContainerRequestAction + /// the value to convert to an instance of . + + public static implicit operator LeaseContainerRequestAction(string value) + { + return new LeaseContainerRequestAction(value); + } + + /// Implicit operator to convert LeaseContainerRequestAction to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseContainerRequestAction + /// 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.LeaseContainerRequestAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseContainerRequestAction + /// 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.LeaseContainerRequestAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/LeaseDuration.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseDuration.Completer.cs new file mode 100644 index 000000000000..2ac1a8ea6b89 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseDuration.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseDuration.TypeConverter.cs new file mode 100644 index 000000000000..5015cc8035ae --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseDuration.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseDuration.cs new file mode 100644 index 000000000000..3b4bbcb57986 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseShareAction.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseShareAction.Completer.cs new file mode 100644 index 000000000000..50b13e295813 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseShareAction.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseShareAction.TypeConverter.cs new file mode 100644 index 000000000000..526f064de637 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseShareAction.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseShareAction.cs new file mode 100644 index 000000000000..9db3f0c599ed --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseState.Completer.cs new file mode 100644 index 000000000000..8cf0bddaa880 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseState.TypeConverter.cs new file mode 100644 index 000000000000..71824fe5fb80 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseState.cs new file mode 100644 index 000000000000..354b0b835ee0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseStatus.Completer.cs new file mode 100644 index 000000000000..24b58c8b37dc --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseStatus.TypeConverter.cs new file mode 100644 index 000000000000..b36e3b504bdf --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/LeaseStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/LeaseStatus.cs new file mode 100644 index 000000000000..db76ea629163 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListContainersInclude.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListContainersInclude.Completer.cs new file mode 100644 index 000000000000..10d145a3dff8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListContainersInclude.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListContainersInclude.TypeConverter.cs new file mode 100644 index 000000000000..85c024eb9316 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListContainersInclude.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListContainersInclude.cs new file mode 100644 index 000000000000..f5acc3febe84 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.Completer.cs new file mode 100644 index 000000000000..2fa61c833df1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.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 +{ + + /// Argument completer implementation for ListEncryptionScopesInclude. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesIncludeTypeConverter))] + public partial struct ListEncryptionScopesInclude : + 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) || "All".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'All'", "All", global::System.Management.Automation.CompletionResultType.ParameterValue, "All"); + } + 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.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.TypeConverter.cs new file mode 100644 index 000000000000..a81b2a95c2c4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.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 ListEncryptionScopesInclude. + public partial class ListEncryptionScopesIncludeTypeConverter : + 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) => ListEncryptionScopesInclude.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.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.cs new file mode 100644 index 000000000000..20a5feea6a38 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListEncryptionScopesInclude.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 +{ + + public partial struct ListEncryptionScopesInclude : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude All = @"All"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude Enabled = @"Enabled"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ListEncryptionScopesInclude + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ListEncryptionScopesInclude(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ListEncryptionScopesInclude + /// 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.ListEncryptionScopesInclude e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ListEncryptionScopesInclude (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 ListEncryptionScopesInclude && Equals((ListEncryptionScopesInclude)obj); + } + + /// Returns hashCode for enum ListEncryptionScopesInclude + /// 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 ListEncryptionScopesInclude(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ListEncryptionScopesInclude + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ListEncryptionScopesInclude + /// the value to convert to an instance of . + + public static implicit operator ListEncryptionScopesInclude(string value) + { + return new ListEncryptionScopesInclude(value); + } + + /// Implicit operator to convert ListEncryptionScopesInclude to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude e) + { + return e._value; + } + + /// Overriding != operator for enum ListEncryptionScopesInclude + /// 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.ListEncryptionScopesInclude e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ListEncryptionScopesInclude + /// 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.ListEncryptionScopesInclude e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ListKeyExpand.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListKeyExpand.Completer.cs new file mode 100644 index 000000000000..d5c2b12bc73f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListKeyExpand.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListKeyExpand.TypeConverter.cs new file mode 100644 index 000000000000..df399a008ce9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListKeyExpand.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListKeyExpand.cs new file mode 100644 index 000000000000..c92428ce431e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.Completer.cs new file mode 100644 index 000000000000..775ededef8bd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.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 ListLocalUserIncludeParam. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParamTypeConverter))] + public partial struct ListLocalUserIncludeParam : + 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) || "nfsv3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'nfsv3'", "nfsv3", global::System.Management.Automation.CompletionResultType.ParameterValue, "nfsv3"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.TypeConverter.cs new file mode 100644 index 000000000000..5a213c7e47bd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.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 ListLocalUserIncludeParam. + public partial class ListLocalUserIncludeParamTypeConverter : + 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) => ListLocalUserIncludeParam.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.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.cs new file mode 100644 index 000000000000..f2b38429e6fc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ListLocalUserIncludeParam.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 ListLocalUserIncludeParam : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam Nfsv3 = @"nfsv3"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ListLocalUserIncludeParam + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ListLocalUserIncludeParam(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ListLocalUserIncludeParam + /// 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.ListLocalUserIncludeParam e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ListLocalUserIncludeParam (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 ListLocalUserIncludeParam && Equals((ListLocalUserIncludeParam)obj); + } + + /// Returns hashCode for enum ListLocalUserIncludeParam + /// 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 ListLocalUserIncludeParam(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ListLocalUserIncludeParam + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ListLocalUserIncludeParam + /// the value to convert to an instance of . + + public static implicit operator ListLocalUserIncludeParam(string value) + { + return new ListLocalUserIncludeParam(value); + } + + /// Implicit operator to convert ListLocalUserIncludeParam to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam e) + { + return e._value; + } + + /// Overriding != operator for enum ListLocalUserIncludeParam + /// 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.ListLocalUserIncludeParam e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ListLocalUserIncludeParam + /// 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.ListLocalUserIncludeParam e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ManagementPolicyName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ManagementPolicyName.Completer.cs new file mode 100644 index 000000000000..a6feed838914 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ManagementPolicyName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ManagementPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..8d9503540caa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ManagementPolicyName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ManagementPolicyName.cs new file mode 100644 index 000000000000..570969608a38 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/MigrationName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.Completer.cs new file mode 100644 index 000000000000..593a3fc87d2b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.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 MigrationName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationNameTypeConverter))] + public partial struct MigrationName : + 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.DefaultTag/generated/api/Support/MigrationName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.TypeConverter.cs new file mode 100644 index 000000000000..d023d80e0f77 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.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 MigrationName. + public partial class MigrationNameTypeConverter : + 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) => MigrationName.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.DefaultTag/generated/api/Support/MigrationName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.cs new file mode 100644 index 000000000000..72f41062d9a7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationName.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 MigrationName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrationName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrationName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrationName + /// 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.MigrationName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrationName (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 MigrationName && Equals((MigrationName)obj); + } + + /// Returns hashCode for enum MigrationName + /// 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 MigrationName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrationName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrationName + /// the value to convert to an instance of . + + public static implicit operator MigrationName(string value) + { + return new MigrationName(value); + } + + /// Implicit operator to convert MigrationName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName e) + { + return e._value; + } + + /// Overriding != operator for enum MigrationName + /// 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.MigrationName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrationName + /// 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.MigrationName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/MigrationState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationState.Completer.cs new file mode 100644 index 000000000000..e612b6cb545a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/MigrationState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationState.TypeConverter.cs new file mode 100644 index 000000000000..ed83074726c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/MigrationState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationState.cs new file mode 100644 index 000000000000..d60d7ec84c54 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/MigrationStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.Completer.cs new file mode 100644 index 000000000000..e16bd0d3e087 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.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 +{ + + /// Current status of migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatusTypeConverter))] + public partial struct MigrationStatus : + 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) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SubmittedForConversion".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SubmittedForConversion'", "SubmittedForConversion", global::System.Management.Automation.CompletionResultType.ParameterValue, "SubmittedForConversion"); + } + 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.DefaultTag/generated/api/Support/MigrationStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.TypeConverter.cs new file mode 100644 index 000000000000..568e99c5e479 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.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 +{ + + /// Current status of migration + public partial class MigrationStatusTypeConverter : + 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) => MigrationStatus.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.DefaultTag/generated/api/Support/MigrationStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.cs new file mode 100644 index 000000000000..9d28ae2f34d7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MigrationStatus.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 +{ + + /// Current status of migration + public partial struct MigrationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus Complete = @"Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus SubmittedForConversion = @"SubmittedForConversion"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrationStatus + /// 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.MigrationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrationStatus (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 MigrationStatus && Equals((MigrationStatus)obj); + } + + /// Returns hashCode for enum MigrationStatus + /// 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 MigrationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrationStatus + /// the value to convert to an instance of . + + public static implicit operator MigrationStatus(string value) + { + return new MigrationStatus(value); + } + + /// Implicit operator to convert MigrationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum MigrationStatus + /// 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.MigrationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrationStatus + /// 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.MigrationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.Completer.cs new file mode 100644 index 000000000000..b306aa075810 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.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 +{ + + /// + /// 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TLS1_3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TLS1_3'", "TLS1_3", global::System.Management.Automation.CompletionResultType.ParameterValue, "TLS1_3"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.TypeConverter.cs new file mode 100644 index 000000000000..014df8fc93ed --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/MinimumTlsVersion.cs b/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.cs new file mode 100644 index 000000000000..9bed16824e3d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/MinimumTlsVersion.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 +{ + + /// + /// 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"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion Tls13 = @"TLS1_3"; + + /// 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.DefaultTag/generated/api/Support/Name.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Name.Completer.cs new file mode 100644 index 000000000000..9e492cf0f80d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Name.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Name.TypeConverter.cs new file mode 100644 index 000000000000..384a32c427f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Name.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Name.cs new file mode 100644 index 000000000000..2a1d07ca329e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.Completer.cs new file mode 100644 index 000000000000..72460efacee5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.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 +{ + + /// Provisioning state of Network Security Perimeter configuration propagation + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningStateTypeConverter))] + public partial struct NetworkSecurityPerimeterConfigurationProvisioningState : + 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) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); + } + 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) || "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) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..657076a3e062 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.TypeConverter.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.Support +{ + + /// Provisioning state of Network Security Perimeter configuration propagation + public partial class NetworkSecurityPerimeterConfigurationProvisioningStateTypeConverter : + 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) => NetworkSecurityPerimeterConfigurationProvisioningState.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.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.cs new file mode 100644 index 000000000000..f278950d3006 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NetworkSecurityPerimeterConfigurationProvisioningState.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 +{ + + /// Provisioning state of Network Security Perimeter configuration propagation + public partial struct NetworkSecurityPerimeterConfigurationProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState Accepted = @"Accepted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState Succeeded = @"Succeeded"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Conversion from arbitrary object to NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkSecurityPerimeterConfigurationProvisioningState(global::System.Convert.ToString(value)); + } + + /// + /// Compares values of enum type NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// 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.NetworkSecurityPerimeterConfigurationProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type NetworkSecurityPerimeterConfigurationProvisioningState (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 NetworkSecurityPerimeterConfigurationProvisioningState && Equals((NetworkSecurityPerimeterConfigurationProvisioningState)obj); + } + + /// + /// Returns hashCode for enum NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// 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 NetworkSecurityPerimeterConfigurationProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// + /// Returns string representation for NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) + { + return new NetworkSecurityPerimeterConfigurationProvisioningState(value); + } + + /// + /// Implicit operator to convert NetworkSecurityPerimeterConfigurationProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState e) + { + return e._value; + } + + /// + /// Overriding != operator for enum NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// 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.NetworkSecurityPerimeterConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// + /// Overriding == operator for enum NetworkSecurityPerimeterConfigurationProvisioningState + /// + /// 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.NetworkSecurityPerimeterConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NetworkSecurityPerimeterConfigurationProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.Completer.cs new file mode 100644 index 000000000000..d3d11b0abb00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.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 +{ + + /// Direction of Access Rule + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirectionTypeConverter))] + public partial struct NspAccessRuleDirection : + 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) || "Inbound".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Inbound'", "Inbound", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inbound"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Outbound".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Outbound'", "Outbound", global::System.Management.Automation.CompletionResultType.ParameterValue, "Outbound"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.TypeConverter.cs new file mode 100644 index 000000000000..5b64b5407b69 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.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 +{ + + /// Direction of Access Rule + public partial class NspAccessRuleDirectionTypeConverter : + 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) => NspAccessRuleDirection.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.DefaultTag/generated/api/Support/NspAccessRuleDirection.cs b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.cs new file mode 100644 index 000000000000..3b1d81c9a994 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/NspAccessRuleDirection.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 +{ + + /// Direction of Access Rule + public partial struct NspAccessRuleDirection : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection Inbound = @"Inbound"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection Outbound = @"Outbound"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NspAccessRuleDirection + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NspAccessRuleDirection(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NspAccessRuleDirection + /// 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.NspAccessRuleDirection e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NspAccessRuleDirection (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 NspAccessRuleDirection && Equals((NspAccessRuleDirection)obj); + } + + /// Returns hashCode for enum NspAccessRuleDirection + /// 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 NspAccessRuleDirection(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NspAccessRuleDirection + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NspAccessRuleDirection + /// the value to convert to an instance of . + + public static implicit operator NspAccessRuleDirection(string value) + { + return new NspAccessRuleDirection(value); + } + + /// Implicit operator to convert NspAccessRuleDirection to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection e) + { + return e._value; + } + + /// Overriding != operator for enum NspAccessRuleDirection + /// 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.NspAccessRuleDirection e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NspAccessRuleDirection + /// 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.NspAccessRuleDirection e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NspAccessRuleDirection e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ObjectType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ObjectType.Completer.cs new file mode 100644 index 000000000000..7552727580e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ObjectType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ObjectType.TypeConverter.cs new file mode 100644 index 000000000000..004dfc750213 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ObjectType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ObjectType.cs new file mode 100644 index 000000000000..61fb03552873 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Permissions.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Permissions.Completer.cs new file mode 100644 index 000000000000..b7e6a44ff8f4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Permissions.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Permissions.TypeConverter.cs new file mode 100644 index 000000000000..50ca03892ac2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Permissions.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Permissions.cs new file mode 100644 index 000000000000..fb0c5574d5c6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PostFailoverRedundancy.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.Completer.cs new file mode 100644 index 000000000000..8f7169d3f62f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.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 redundancy type of the account after an account failover is performed. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancyTypeConverter))] + public partial struct PostFailoverRedundancy : + 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_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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.TypeConverter.cs new file mode 100644 index 000000000000..47ed06438042 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.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 redundancy type of the account after an account failover is performed. + public partial class PostFailoverRedundancyTypeConverter : + 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) => PostFailoverRedundancy.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.DefaultTag/generated/api/Support/PostFailoverRedundancy.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.cs new file mode 100644 index 000000000000..adb3e9d6ceb3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostFailoverRedundancy.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 redundancy type of the account after an account failover is performed. + public partial struct PostFailoverRedundancy : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy StandardLrs = @"Standard_LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy StandardZrs = @"Standard_ZRS"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PostFailoverRedundancy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PostFailoverRedundancy(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PostFailoverRedundancy + /// 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.PostFailoverRedundancy e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PostFailoverRedundancy (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 PostFailoverRedundancy && Equals((PostFailoverRedundancy)obj); + } + + /// Returns hashCode for enum PostFailoverRedundancy + /// 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 PostFailoverRedundancy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PostFailoverRedundancy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PostFailoverRedundancy + /// the value to convert to an instance of . + + public static implicit operator PostFailoverRedundancy(string value) + { + return new PostFailoverRedundancy(value); + } + + /// Implicit operator to convert PostFailoverRedundancy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy e) + { + return e._value; + } + + /// Overriding != operator for enum PostFailoverRedundancy + /// 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.PostFailoverRedundancy e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PostFailoverRedundancy + /// 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.PostFailoverRedundancy e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostFailoverRedundancy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.Completer.cs new file mode 100644 index 000000000000..92a7cbecc9b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.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 redundancy type of the account after a planned account failover is performed. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancyTypeConverter))] + public partial struct PostPlannedFailoverRedundancy : + 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_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_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_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_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.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.TypeConverter.cs new file mode 100644 index 000000000000..0978703caee0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.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 redundancy type of the account after a planned account failover is performed. + /// + public partial class PostPlannedFailoverRedundancyTypeConverter : + 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) => PostPlannedFailoverRedundancy.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.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.cs new file mode 100644 index 000000000000..13b4773ee895 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PostPlannedFailoverRedundancy.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.Support +{ + + /// + /// The redundancy type of the account after a planned account failover is performed. + /// + public partial struct PostPlannedFailoverRedundancy : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy StandardGrs = @"Standard_GRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy StandardGzrs = @"Standard_GZRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy StandardRagrs = @"Standard_RAGRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy StandardRagzrs = @"Standard_RAGZRS"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PostPlannedFailoverRedundancy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PostPlannedFailoverRedundancy(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PostPlannedFailoverRedundancy + /// 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.PostPlannedFailoverRedundancy e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PostPlannedFailoverRedundancy (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 PostPlannedFailoverRedundancy && Equals((PostPlannedFailoverRedundancy)obj); + } + + /// Returns hashCode for enum PostPlannedFailoverRedundancy + /// 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 PostPlannedFailoverRedundancy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PostPlannedFailoverRedundancy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PostPlannedFailoverRedundancy + /// the value to convert to an instance of . + + public static implicit operator PostPlannedFailoverRedundancy(string value) + { + return new PostPlannedFailoverRedundancy(value); + } + + /// Implicit operator to convert PostPlannedFailoverRedundancy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy e) + { + return e._value; + } + + /// Overriding != operator for enum PostPlannedFailoverRedundancy + /// 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.PostPlannedFailoverRedundancy e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PostPlannedFailoverRedundancy + /// 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.PostPlannedFailoverRedundancy e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PostPlannedFailoverRedundancy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs new file mode 100644 index 000000000000..fe05f40e14fd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..db14740f8b6d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..c3b361180ee1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs new file mode 100644 index 000000000000..6ffced4a0691 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs new file mode 100644 index 000000000000..69fb13198971 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..c8e56c6fd30f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ProvisioningState.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ProvisioningState.Completer.cs new file mode 100644 index 000000000000..804ee0675083 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ProvisioningState.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 +{ + + /// 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidateSubscriptionQuotaBegin".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidateSubscriptionQuotaBegin'", "ValidateSubscriptionQuotaBegin", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidateSubscriptionQuotaBegin"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidateSubscriptionQuotaEnd".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidateSubscriptionQuotaEnd'", "ValidateSubscriptionQuotaEnd", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidateSubscriptionQuotaEnd"); + } + 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) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + 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.DefaultTag/generated/api/Support/ProvisioningState.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..3d9cf80456fc --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ProvisioningState.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ProvisioningState.cs new file mode 100644 index 000000000000..55f1fa15d80c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ProvisioningState.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.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 Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState ResolvingDns = @"ResolvingDNS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState ValidateSubscriptionQuotaBegin = @"ValidateSubscriptionQuotaBegin"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState ValidateSubscriptionQuotaEnd = @"ValidateSubscriptionQuotaEnd"; + + /// 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.DefaultTag/generated/api/Support/PublicAccess.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicAccess.Completer.cs new file mode 100644 index 000000000000..a4ae560bb61f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PublicAccess.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicAccess.TypeConverter.cs new file mode 100644 index 000000000000..17739cc89a04 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PublicAccess.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicAccess.cs new file mode 100644 index 000000000000..61177ae2bdb6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/PublicNetworkAccess.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.Completer.cs new file mode 100644 index 000000000000..2d728ff84b7f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.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 +{ + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SecuredByPerimeter".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SecuredByPerimeter'", "SecuredByPerimeter", global::System.Management.Automation.CompletionResultType.ParameterValue, "SecuredByPerimeter"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.TypeConverter.cs new file mode 100644 index 000000000000..bd9fa0330f20 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.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 +{ + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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.DefaultTag/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..9a24d1200f28 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/PublicNetworkAccess.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 +{ + + /// + /// Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + 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"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess SecuredByPerimeter = @"SecuredByPerimeter"; + + /// 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.DefaultTag/generated/api/Support/QueueServiceName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/QueueServiceName.Completer.cs new file mode 100644 index 000000000000..ba22559c56b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/QueueServiceName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/QueueServiceName.TypeConverter.cs new file mode 100644 index 000000000000..e5629aa6108d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/QueueServiceName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/QueueServiceName.cs new file mode 100644 index 000000000000..32ab4dd3034c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Reason.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Reason.Completer.cs new file mode 100644 index 000000000000..87b5b570e50c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Reason.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Reason.TypeConverter.cs new file mode 100644 index 000000000000..e6023d21ab6a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Reason.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Reason.cs new file mode 100644 index 000000000000..325c9561052b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ReasonCode.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ReasonCode.Completer.cs new file mode 100644 index 000000000000..1c41ece5e6c5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ReasonCode.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ReasonCode.TypeConverter.cs new file mode 100644 index 000000000000..4256e383b5b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ReasonCode.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ReasonCode.cs new file mode 100644 index 000000000000..8e3ae5f291f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.Completer.cs new file mode 100644 index 000000000000..bb036a70f2ff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.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 +{ + + /// Access Mode of the resource association + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessModeTypeConverter))] + public partial struct ResourceAssociationAccessMode : + 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) || "Enforced".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enforced'", "Enforced", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enforced"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Learning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Learning'", "Learning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Learning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Audit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Audit'", "Audit", global::System.Management.Automation.CompletionResultType.ParameterValue, "Audit"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.TypeConverter.cs new file mode 100644 index 000000000000..9c265b0a2c9f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.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 +{ + + /// Access Mode of the resource association + public partial class ResourceAssociationAccessModeTypeConverter : + 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) => ResourceAssociationAccessMode.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.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.cs new file mode 100644 index 000000000000..39592ed477c6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/ResourceAssociationAccessMode.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 +{ + + /// Access Mode of the resource association + public partial struct ResourceAssociationAccessMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode Audit = @"Audit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode Enforced = @"Enforced"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode Learning = @"Learning"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceAssociationAccessMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceAssociationAccessMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceAssociationAccessMode + /// 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.ResourceAssociationAccessMode e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ResourceAssociationAccessMode (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 ResourceAssociationAccessMode && Equals((ResourceAssociationAccessMode)obj); + } + + /// Returns hashCode for enum ResourceAssociationAccessMode + /// 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 ResourceAssociationAccessMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceAssociationAccessMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceAssociationAccessMode + /// the value to convert to an instance of . + + public static implicit operator ResourceAssociationAccessMode(string value) + { + return new ResourceAssociationAccessMode(value); + } + + /// Implicit operator to convert ResourceAssociationAccessMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceAssociationAccessMode + /// 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.ResourceAssociationAccessMode e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceAssociationAccessMode + /// 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.ResourceAssociationAccessMode e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ResourceAssociationAccessMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/RootSquashType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RootSquashType.Completer.cs new file mode 100644 index 000000000000..de352cebacaa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RootSquashType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RootSquashType.TypeConverter.cs new file mode 100644 index 000000000000..8dd92e015dd2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RootSquashType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RootSquashType.cs new file mode 100644 index 000000000000..fdaeb96e4655 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RoutingChoice.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RoutingChoice.Completer.cs new file mode 100644 index 000000000000..9211b7eaec92 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RoutingChoice.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RoutingChoice.TypeConverter.cs new file mode 100644 index 000000000000..0d4e3656cc8e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RoutingChoice.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RoutingChoice.cs new file mode 100644 index 000000000000..175b5d747844 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/RunResult.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.Completer.cs new file mode 100644 index 000000000000..b3a876f4bc20 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.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 +{ + + /// Represents the overall result of the execution for the run instance + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResultTypeConverter))] + public partial struct RunResult : + 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) || "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.DefaultTag/generated/api/Support/RunResult.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.TypeConverter.cs new file mode 100644 index 000000000000..9ddc83cec162 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.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 +{ + + /// Represents the overall result of the execution for the run instance + public partial class RunResultTypeConverter : + 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) => RunResult.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.DefaultTag/generated/api/Support/RunResult.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.cs new file mode 100644 index 000000000000..9e7371cf75f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunResult.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 +{ + + /// Represents the overall result of the execution for the run instance + public partial struct RunResult : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RunResult + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RunResult(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RunResult + /// 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.RunResult e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RunResult (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 RunResult && Equals((RunResult)obj); + } + + /// Returns hashCode for enum RunResult + /// 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 RunResult(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RunResult + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RunResult + /// the value to convert to an instance of . + + public static implicit operator RunResult(string value) + { + return new RunResult(value); + } + + /// Implicit operator to convert RunResult to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult e) + { + return e._value; + } + + /// Overriding != operator for enum RunResult + /// 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.RunResult e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RunResult + /// 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.RunResult e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunResult e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.Completer.cs new file mode 100644 index 000000000000..1f916b27a364 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.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 +{ + + /// Represents the status of the execution. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnumTypeConverter))] + public partial struct RunStatusEnum : + 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) || "Finished".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Finished'", "Finished", global::System.Management.Automation.CompletionResultType.ParameterValue, "Finished"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.TypeConverter.cs new file mode 100644 index 000000000000..cc64eed6c89b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.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 +{ + + /// Represents the status of the execution. + public partial class RunStatusEnumTypeConverter : + 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) => RunStatusEnum.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.DefaultTag/generated/api/Support/RunStatusEnum.cs b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.cs new file mode 100644 index 000000000000..cbb322a96e81 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/RunStatusEnum.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 +{ + + /// Represents the status of the execution. + public partial struct RunStatusEnum : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum Finished = @"Finished"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum InProgress = @"InProgress"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RunStatusEnum + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RunStatusEnum(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RunStatusEnum + /// 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.RunStatusEnum e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RunStatusEnum (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 RunStatusEnum && Equals((RunStatusEnum)obj); + } + + /// Returns hashCode for enum RunStatusEnum + /// 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 RunStatusEnum(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RunStatusEnum + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RunStatusEnum + /// the value to convert to an instance of . + + public static implicit operator RunStatusEnum(string value) + { + return new RunStatusEnum(value); + } + + /// Implicit operator to convert RunStatusEnum to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum e) + { + return e._value; + } + + /// Overriding != operator for enum RunStatusEnum + /// 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.RunStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RunStatusEnum + /// 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.RunStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RunStatusEnum e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/Schedule.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Schedule.Completer.cs new file mode 100644 index 000000000000..6e739516f8fd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Schedule.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Schedule.TypeConverter.cs new file mode 100644 index 000000000000..9ec08f50d973 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Schedule.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Schedule.cs new file mode 100644 index 000000000000..267ee768c2ee --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Services.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Services.Completer.cs new file mode 100644 index 000000000000..2d4c4d27c006 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Services.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Services.TypeConverter.cs new file mode 100644 index 000000000000..9b9349e4475e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Services.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Services.cs new file mode 100644 index 000000000000..66b0a5b46d86 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/Severity.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.Completer.cs new file mode 100644 index 000000000000..57ca351b0007 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.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 +{ + + /// Severity of the issue. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SeverityTypeConverter))] + public partial struct Severity : + 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) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/Severity.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.TypeConverter.cs new file mode 100644 index 000000000000..af22f05656da --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.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 +{ + + /// Severity of the issue. + public partial class SeverityTypeConverter : + 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) => Severity.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.DefaultTag/generated/api/Support/Severity.cs b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.cs new file mode 100644 index 000000000000..447ae50adefc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/Severity.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 +{ + + /// Severity of the issue. + public partial struct Severity : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Severity + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Severity(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Severity + /// 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.Severity e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Severity (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 Severity && Equals((Severity)obj); + } + + /// Returns hashCode for enum Severity + /// 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 Severity(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Severity + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Severity + /// the value to convert to an instance of . + + public static implicit operator Severity(string value) + { + return new Severity(value); + } + + /// Implicit operator to convert Severity to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity e) + { + return e._value; + } + + /// Overriding != operator for enum Severity + /// 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.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Severity + /// 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.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Severity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/ShareAccessTier.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ShareAccessTier.Completer.cs new file mode 100644 index 000000000000..9bae78219421 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ShareAccessTier.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ShareAccessTier.TypeConverter.cs new file mode 100644 index 000000000000..0f564b88f30f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/ShareAccessTier.cs b/swaggerci/storage.DefaultTag/generated/api/Support/ShareAccessTier.cs new file mode 100644 index 000000000000..996382d873f8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResource.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResource.Completer.cs new file mode 100644 index 000000000000..9d2728a45fef --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResource.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResource.TypeConverter.cs new file mode 100644 index 000000000000..6d30f544a7ca --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResource.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResource.cs new file mode 100644 index 000000000000..a64854ed158d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResourceTypes.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResourceTypes.Completer.cs new file mode 100644 index 000000000000..de71f640a3e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResourceTypes.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResourceTypes.TypeConverter.cs new file mode 100644 index 000000000000..eaf61ade8352 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SignedResourceTypes.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SignedResourceTypes.cs new file mode 100644 index 000000000000..ec71069f1274 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuConversionStatus.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuConversionStatus.Completer.cs new file mode 100644 index 000000000000..165332ed95ea --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuConversionStatus.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuConversionStatus.TypeConverter.cs new file mode 100644 index 000000000000..2c35201d9de2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuConversionStatus.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuConversionStatus.cs new file mode 100644 index 000000000000..3a9fa3d187f0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuName.Completer.cs new file mode 100644 index 000000000000..1d97641380c0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuName.TypeConverter.cs new file mode 100644 index 000000000000..2691000c9d01 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuName.cs new file mode 100644 index 000000000000..8a2a6af42fb3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuTier.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuTier.Completer.cs new file mode 100644 index 000000000000..8655a5bf1d62 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuTier.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuTier.TypeConverter.cs new file mode 100644 index 000000000000..ca3b32e9ecc7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/SkuTier.cs b/swaggerci/storage.DefaultTag/generated/api/Support/SkuTier.cs new file mode 100644 index 000000000000..2357631b86d1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/State.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/State.Completer.cs new file mode 100644 index 000000000000..43a0d4afebee --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/State.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/State.TypeConverter.cs new file mode 100644 index 000000000000..e489828fe9bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/State.cs b/swaggerci/storage.DefaultTag/generated/api/Support/State.cs new file mode 100644 index 000000000000..b1eb23c3e2d0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/StorageAccountExpand.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/StorageAccountExpand.Completer.cs new file mode 100644 index 000000000000..2d2a759c4a89 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/StorageAccountExpand.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/StorageAccountExpand.TypeConverter.cs new file mode 100644 index 000000000000..d9e15eda33e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/StorageAccountExpand.cs b/swaggerci/storage.DefaultTag/generated/api/Support/StorageAccountExpand.cs new file mode 100644 index 000000000000..e68caf23fcf0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/TableServiceName.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TableServiceName.Completer.cs new file mode 100644 index 000000000000..af2e71f05bdb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/TableServiceName.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TableServiceName.TypeConverter.cs new file mode 100644 index 000000000000..1f9a416fc0fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/TableServiceName.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TableServiceName.cs new file mode 100644 index 000000000000..36d677b4c61e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/TriggerType.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.Completer.cs new file mode 100644 index 000000000000..369512805e41 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.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 trigger type of the storage task assignment execution + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerTypeTypeConverter))] + public partial struct TriggerType : + 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) || "RunOnce".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RunOnce'", "RunOnce", global::System.Management.Automation.CompletionResultType.ParameterValue, "RunOnce"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OnSchedule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OnSchedule'", "OnSchedule", global::System.Management.Automation.CompletionResultType.ParameterValue, "OnSchedule"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.TypeConverter.cs new file mode 100644 index 000000000000..234e870143a6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.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 trigger type of the storage task assignment execution + public partial class TriggerTypeTypeConverter : + 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) => TriggerType.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.DefaultTag/generated/api/Support/TriggerType.cs b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.cs new file mode 100644 index 000000000000..7fb8ef10ffbe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/api/Support/TriggerType.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 trigger type of the storage task assignment execution + public partial struct TriggerType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType OnSchedule = @"OnSchedule"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType RunOnce = @"RunOnce"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TriggerType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TriggerType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TriggerType + /// 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.TriggerType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TriggerType (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 TriggerType && Equals((TriggerType)obj); + } + + /// Returns hashCode for enum TriggerType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TriggerType + /// 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 TriggerType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to TriggerType + /// the value to convert to an instance of . + + public static implicit operator TriggerType(string value) + { + return new TriggerType(value); + } + + /// Implicit operator to convert TriggerType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType e) + { + return e._value; + } + + /// Overriding != operator for enum TriggerType + /// 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.TriggerType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TriggerType + /// 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.TriggerType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/api/Support/UsageUnit.Completer.cs b/swaggerci/storage.DefaultTag/generated/api/Support/UsageUnit.Completer.cs new file mode 100644 index 000000000000..50fc7ff3be20 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/UsageUnit.TypeConverter.cs b/swaggerci/storage.DefaultTag/generated/api/Support/UsageUnit.TypeConverter.cs new file mode 100644 index 000000000000..7677493ba90d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/api/Support/UsageUnit.cs b/swaggerci/storage.DefaultTag/generated/api/Support/UsageUnit.cs new file mode 100644 index 000000000000..557736114fb4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs new file mode 100644 index 000000000000..13059139ca1c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.ILegalHold) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.cs new file mode 100644 index 000000000000..ca7b21ad790d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", ApiVersion = "2023-05-01")] + 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.Api20230501.ILegalHold _legalHoldBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.cs new file mode 100644 index 000000000000..813711d2e196 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.ILegalHold) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.cs new file mode 100644 index 000000000000..812ed6ffe983 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", ApiVersion = "2023-05-01")] + 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.Api20230501.ILegalHold _legalHoldBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_Get.cs new file mode 100644 index 000000000000..7b7200ca9355 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_Get.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; + + /// Gets the status of the ongoing migration for the specified storage account. + /// + /// [OpenAPI] GetCustomerInitiatedMigration=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountCustomerInitiatedMigration_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the status of the ongoing migration for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageAccountCustomerInitiatedMigration_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageAccountMigration + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountCustomerInitiatedMigration_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.StorageAccountsGetCustomerInitiatedMigration(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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageAccountMigration + /// 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.Api20230501.IStorageAccountMigration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_GetViaIdentity.cs new file mode 100644 index 000000000000..f878ce5a0537 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountCustomerInitiatedMigration_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 status of the ongoing migration for the specified storage account. + /// + /// [OpenAPI] GetCustomerInitiatedMigration=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountCustomerInitiatedMigration_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the status of the ongoing migration for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageAccountCustomerInitiatedMigration_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageAccountMigration + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountCustomerInitiatedMigration_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.StorageAccountsGetCustomerInitiatedMigrationViaIdentity(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.StorageAccountsGetCustomerInitiatedMigration(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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageAccountMigration + /// 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.Api20230501.IStorageAccountMigration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountKey_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountKey_List.cs new file mode 100644 index 000000000000..27e030752908 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountKey_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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_Get.cs new file mode 100644 index 000000000000..255a9c4f40f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_Get.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..20cdad38c24b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_List.cs new file mode 100644 index 000000000000..682b9125621f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_List.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IAccountSasParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IListAccountSasResponse + WriteObject((await response).AccountSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs new file mode 100644 index 000000000000..23ba88fe05f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", ApiVersion = "2023-05-01")] + 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.Api20230501.IAccountSasParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IListAccountSasResponse + WriteObject((await response).AccountSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_List.cs new file mode 100644 index 000000000000..4e8ccf7a53b7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_List.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IServiceSasParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IListServiceSasResponse + WriteObject((await response).ServiceSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs new file mode 100644 index 000000000000..c0d0cc7764fc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs @@ -0,0 +1,604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", ApiVersion = "2023-05-01")] + 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.Api20230501.IServiceSasParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IListServiceSasResponse + WriteObject((await response).ServiceSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccount_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccount_List.cs new file mode 100644 index 000000000000..14f61b4aaa25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccount_List.cs @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageAccount_List1.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccount_List1.cs new file mode 100644 index 000000000000..d755aa8c90a6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageAccount_List1.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_Get.cs new file mode 100644 index 000000000000..97bb984c753a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_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 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..aa4d12756655 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_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 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_Get.cs new file mode 100644 index 000000000000..91686ef7687b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_Get.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; + + /// 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.Api20230501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified container. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs new file mode 100644 index 000000000000..45bf9511ccff --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified container. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_List.cs new file mode 100644 index 000000000000..62abbcdf1ad3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobContainer_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.cs new file mode 100644 index 000000000000..6d547794e3c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..2735a4146cf4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.cs new file mode 100644 index 000000000000..f1487106168e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_Get.cs new file mode 100644 index 000000000000..52b6f2cb6d47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_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 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..ba7b44a687da --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobService_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobService_List.cs new file mode 100644 index 000000000000..a96287a27bd7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageBlobService_List.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs new file mode 100644 index 000000000000..056979e9cf80 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get properties of specified deleted account resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IDeletedAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs new file mode 100644 index 000000000000..adadf1f1b9a0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get properties of specified deleted account resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IDeletedAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_List.cs new file mode 100644 index 000000000000..ac8e57ec2d3f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageDeletedAccount_List.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists deleted accounts under the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_Get.cs new file mode 100644 index 000000000000..dcebd088de98 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_Get.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; + + /// 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.Api20230501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs new file mode 100644 index 000000000000..0e14130bbff8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_List.cs new file mode 100644 index 000000000000..a21052884749 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageEncryptionScope_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 encryption scope names starting with the filter will be listed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, only encryption scope names starting with the filter will be listed.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, only encryption scope 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.ListEncryptionScopesInclude _include; + + /// + /// Optional, when specified, will list encryption scopes with the specific state. Defaults to All + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, when specified, will list encryption scopes with the specific state. Defaults to All")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, when specified, will list encryption scopes with the specific state. Defaults to All", + SerializedName = @"$include", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude) })] + [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.ListEncryptionScopesInclude))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListEncryptionScopesInclude 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 int _maxpagesize; + + /// + /// Optional, specifies the maximum number of encryption scopes that will be included in the list response. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, specifies the maximum number of encryption scopes that will be included in the list response.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, specifies the maximum number of encryption scopes that will be included in the list response.", + SerializedName = @"$maxpagesize", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public int 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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : default(int?), 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 : default(int?),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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs new file mode 100644 index 000000000000..b9de51427759 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..791419f9f8e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileService_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileService_List.cs new file mode 100644 index 000000000000..2d1d44e7ced9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileService_List.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; + + /// 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.Api20230501.IFileServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all file services in storage accounts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageFileShare_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_Get.cs new file mode 100644 index 000000000000..5a4caa515109 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_Get.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.cs new file mode 100644 index 000000000000..9b5399ba90f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.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; + + /// 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.Api20230501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_List.cs new file mode 100644 index 000000000000..1b4f24c86e80 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageFileShare_List.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; + + /// 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.Api20230501.IFileShareItem))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all shares.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageLocalUserKey_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUserKey_List.cs new file mode 100644 index 000000000000..3f0a6aee46cb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUserKey_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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_Get.cs new file mode 100644 index 000000000000..2c2dfc9aa35b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_Get.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs new file mode 100644 index 000000000000..74911fc06133 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_List.cs new file mode 100644 index 000000000000..769ee58660bc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageLocalUser_List.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List the local users associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 local user names starting with the filter will be listed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, only local user names starting with the filter will be listed.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, only local user 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.ListLocalUserIncludeParam _include; + + /// + /// Optional, when specified, will list local users enabled for the specific protocol. Lists all users by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, when specified, will list local users enabled for the specific protocol. Lists all users by default.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, when specified, will list local users enabled for the specific protocol. Lists all users by default.", + SerializedName = @"$include", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam) })] + [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.ListLocalUserIncludeParam))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListLocalUserIncludeParam 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 int _maxpagesize; + + /// + /// Optional, specifies the maximum number of local users that will be included in the list response. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, specifies the maximum number of local users that will be included in the list response.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, specifies the maximum number of local users that will be included in the list response.", + SerializedName = @"$maxpagesize", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public int 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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : default(int?), this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : 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 : default(int?),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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : default(int?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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, SubscriptionId=SubscriptionId, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : default(int?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_Get.cs new file mode 100644 index 000000000000..574b46581f26 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_Get.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 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.Api20230501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..e3e4cc509617 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.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; + + /// 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.Api20230501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_Get.cs new file mode 100644 index 000000000000..f2e4dd54947f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_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 effective NetworkSecurityPerimeterConfiguration for association + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageNetworkSecurityPerimeterConfiguration_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets effective NetworkSecurityPerimeterConfiguration for association")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageNetworkSecurityPerimeterConfiguration_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 for Network Security Perimeter configuration + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name for Network Security Perimeter configuration")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name for Network Security Perimeter configuration", + SerializedName = @"networkSecurityPerimeterConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("NetworkSecurityPerimeterConfigurationName")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageNetworkSecurityPerimeterConfiguration_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.NetworkSecurityPerimeterConfigurationsGet(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.Api20230501.INetworkSecurityPerimeterConfiguration + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity.cs new file mode 100644 index 000000000000..078b809305da --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity.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; + + /// Gets effective NetworkSecurityPerimeterConfiguration for association + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageNetworkSecurityPerimeterConfiguration_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets effective NetworkSecurityPerimeterConfiguration for association")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageNetworkSecurityPerimeterConfiguration_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzStorageNetworkSecurityPerimeterConfiguration_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.NetworkSecurityPerimeterConfigurationsGetViaIdentity(InputObject.Id, onOk, onDefault, 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) ); + } + 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.NetworkSecurityPerimeterConfigurationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NetworkSecurityPerimeterConfigurationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.NetworkSecurityPerimeterConfigurationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.NetworkSecurityPerimeterConfigurationName ?? 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration + /// 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.Api20230501.INetworkSecurityPerimeterConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_List.cs new file mode 100644 index 000000000000..a5916c9a1fe7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageNetworkSecurityPerimeterConfiguration_List.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 list of effective NetworkSecurityPerimeterConfiguration for storage account + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageNetworkSecurityPerimeterConfiguration_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.INetworkSecurityPerimeterConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets list of effective NetworkSecurityPerimeterConfiguration for storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations", ApiVersion = "2023-05-01")] + public partial class GetAzStorageNetworkSecurityPerimeterConfiguration_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.INetworkSecurityPerimeterConfigurationList + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageNetworkSecurityPerimeterConfiguration_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.NetworkSecurityPerimeterConfigurationsList(SubscriptionId, ResourceGroupName, AccountName, 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,ResourceGroupName=ResourceGroupName,AccountName=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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName }) + { + 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName }) + { + 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.Api20230501.INetworkSecurityPerimeterConfigurationList + /// 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.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.cs new file mode 100644 index 000000000000..b3d2e1f308bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..6e3133908a1e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.cs new file mode 100644 index 000000000000..57e3d7e46001 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageOperation_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageOperation_List.cs new file mode 100644 index 000000000000..a3f9b6446d0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageOperation_List.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; + + /// 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.Api20230501.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all of the available Storage Rest API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/providers/Microsoft.Storage/operations", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs new file mode 100644 index 000000000000..2f4f42141f99 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs new file mode 100644 index 000000000000..4eefe76ed379 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.cs new file mode 100644 index 000000000000..1db360879e7d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStoragePrivateLinkResource_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateLinkResource_List.cs new file mode 100644 index 000000000000..ab6bca1e3d06 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStoragePrivateLinkResource_List.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs new file mode 100644 index 000000000000..a1949cb0d5dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IQueueServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..95805d5f372e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IQueueServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueService_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueService_List.cs new file mode 100644 index 000000000000..05d448799671 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueueService_List.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; + + /// 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.Api20230501.IQueueServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all queue services for the storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageQueue_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_Get.cs new file mode 100644 index 000000000000..fda2bfaa9aa8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_Get.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs new file mode 100644 index 000000000000..7ee65cb2bdb4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_List.cs new file mode 100644 index 000000000000..cb9942eccc92 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageQueue_List.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageSku_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageSku_List.cs new file mode 100644 index 000000000000..caeb7a809b6b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageSku_List.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs new file mode 100644 index 000000000000..782e2addfa4f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITableServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..8b20484080d3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITableServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableService_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableService_List.cs new file mode 100644 index 000000000000..aae6f585de3f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTableService_List.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; + + /// 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.Api20230501.ITableServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all table services for the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageTable_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_Get.cs new file mode 100644 index 000000000000..4a8bdb76dfc6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_Get.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 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs new file mode 100644 index 000000000000..489ae9b2d7a4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_List.cs new file mode 100644 index 000000000000..88980b0891fb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTable_List.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentInstancesReport_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentInstancesReport_List.cs new file mode 100644 index 000000000000..6774395c0bbc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentInstancesReport_List.cs @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// Fetch the report summary of a single storage task assignment's instances + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTaskAssignmentInstancesReport_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Fetch the report summary of a single storage task assignment's instances")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports", ApiVersion = "2023-05-01")] + public partial class GetAzStorageTaskAssignmentInstancesReport_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details.", + 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, specifies the maximum number of storage task assignment instances to be included in the list response. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, specifies the maximum number of storage task assignment instances to be included in the list response.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, specifies the maximum number of storage task assignment instances to be included in the list 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. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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 _storageTaskAssignmentName; + + /// + /// The name of the storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string StorageTaskAssignmentName { get => this._storageTaskAssignmentName; set => this._storageTaskAssignmentName = 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskReportSummary + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTaskAssignmentInstancesReport_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.StorageTaskAssignmentInstancesReportList(SubscriptionId, ResourceGroupName, AccountName, StorageTaskAssignmentName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,StorageTaskAssignmentName=StorageTaskAssignmentName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, StorageTaskAssignmentName=StorageTaskAssignmentName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, StorageTaskAssignmentName=StorageTaskAssignmentName, 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.Api20230501.IStorageTaskReportSummary + /// 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.StorageTaskAssignmentInstancesReportList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_Get.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_Get.cs new file mode 100644 index 000000000000..410e302247be --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_Get.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; + + /// Get the storage task assignment properties + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTaskAssignment_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the storage task assignment properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageTaskAssignment_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageTaskAssignmentName")] + [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. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTaskAssignment_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.StorageTaskAssignmentsGet(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.Api20230501.IStorageTaskAssignment + /// 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.Api20230501.IStorageTaskAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_GetViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_GetViaIdentity.cs new file mode 100644 index 000000000000..74dc002e4872 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 storage task assignment properties + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTaskAssignment_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the storage task assignment properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class GetAzStorageTaskAssignment_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTaskAssignment_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.StorageTaskAssignmentsGetViaIdentity(InputObject.Id, onOk, onDefault, 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) ); + } + 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.StorageTaskAssignmentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageTaskAssignmentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageTaskAssignmentsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.StorageTaskAssignmentName ?? 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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.Api20230501.IStorageTaskAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_List.cs new file mode 100644 index 000000000000..9363da356d48 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignment_List.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 storage task assignments in an account + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTaskAssignment_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all the storage task assignments in an account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments", ApiVersion = "2023-05-01")] + public partial class GetAzStorageTaskAssignment_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 _maxpagesize; + + /// + /// Optional, specifies the maximum number of storage task assignment Ids to be included in the list response. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, specifies the maximum number of storage task assignment Ids to be included in the list response.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, specifies the maximum number of storage task assignment Ids to be included in the list 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. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignmentsList + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTaskAssignment_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.StorageTaskAssignmentsList(SubscriptionId, ResourceGroupName, AccountName, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : 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.Api20230501.IStorageTaskAssignmentsList + /// 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.StorageTaskAssignmentsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentsInstancesReport_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentsInstancesReport_List.cs new file mode 100644 index 000000000000..3e1150d61d25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageTaskAssignmentsInstancesReport_List.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// + /// Fetch the report summary of all the storage task assignments and instances in an account + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/reports" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTaskAssignmentsInstancesReport_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskReportInstance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Fetch the report summary of all the storage task assignments and instances in an account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/reports", ApiVersion = "2023-05-01")] + public partial class GetAzStorageTaskAssignmentsInstancesReport_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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + /// for details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, it can be used to query using reporting properties. See [Constructing Filter Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) for details.", + 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, specifies the maximum number of storage task assignment instances to be included in the list response. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, specifies the maximum number of storage task assignment instances to be included in the list response.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, specifies the maximum number of storage task assignment instances to be included in the list 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. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskReportSummary + /// 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTaskAssignmentsInstancesReport_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.StorageTaskAssignmentsInstancesReportList(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.Api20230501.IStorageTaskReportSummary + /// 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.StorageTaskAssignmentsInstancesReportList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageUsage_List.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageUsage_List.cs new file mode 100644 index 000000000000..6561d750b173 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/GetAzStorageUsage_List.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 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs new file mode 100644 index 000000000000..c1cfa9424113 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs new file mode 100644 index 000000000000..3ac03932d073 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer.cs new file mode 100644 index 000000000000..c9d01147c7e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer.cs @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// + /// [OpenAPI] CustomerInitiatedMigration=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageCustomerStorageAccountInitiatedMigration_Customer", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer : 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IStorageAccountMigration _parameter; + + /// + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration Parameter { get => this._parameter; set => this._parameter = 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.Api50.IErrorResponseAutoGenerated + /// 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 InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer Clone() + { + var clone = new InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzStorageCustomerStorageAccountInitiatedMigration_Customer() + { + + } + + /// 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 'StorageAccountsCustomerInitiatedMigration' 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.StorageAccountsCustomerInitiatedMigration(ResourceGroupName, AccountName, SubscriptionId, 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,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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=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, SubscriptionId=SubscriptionId, 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. + /// + /// 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.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded.cs new file mode 100644 index 000000000000..8efbbfaa851f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded.cs @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// + /// [OpenAPI] CustomerInitiatedMigration=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded : 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 or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigration(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; + + /// current value is 'default' for customer initiated migration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "current value is 'default' for customer initiated migration")] + [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 = @"current value is 'default' for customer initiated migration", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _parametersBody.Name ?? null; set => _parametersBody.Name = 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; } + + /// + /// 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; } + + /// Target sku name for the account + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Target sku name for the 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 = @"Target sku name for the account", + SerializedName = @"targetSkuName", + 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 StorageAccountMigrationDetailTargetSkuName { get => _parametersBody.DetailTargetSkuName; set => _parametersBody.DetailTargetSkuName = 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; } + + /// SrpAccountMigrationType in ARM contract which is 'accountMigrations' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "SrpAccountMigrationType in ARM contract which is 'accountMigrations'")] + [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 = @"SrpAccountMigrationType in ARM contract which is 'accountMigrations'", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => _parametersBody.Type ?? null; set => _parametersBody.Type = 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.Api50.IErrorResponseAutoGenerated + /// 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 InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded Clone() + { + var clone = new InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerExpanded() + { + + } + + /// 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 'StorageAccountsCustomerInitiatedMigration' 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.StorageAccountsCustomerInitiatedMigration(ResourceGroupName, AccountName, SubscriptionId, _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,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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=_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, 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. + /// + /// 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.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity.cs new file mode 100644 index 000000000000..b90957782831 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity.cs @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// + /// [OpenAPI] CustomerInitiatedMigration=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity : 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IStorageAccountMigration _parameter; + + /// + /// The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration Parameter { get => this._parameter; set => this._parameter = 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; } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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 InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity Clone() + { + var clone = new InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentity() + { + + } + + /// 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 'StorageAccountsCustomerInitiatedMigration' 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.StorageAccountsCustomerInitiatedMigrationViaIdentity(InputObject.Id, 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.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.StorageAccountsCustomerInitiatedMigration(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? 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 { 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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=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 { 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. + /// + /// 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.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded.cs new file mode 100644 index 000000000000..630283cb5fae --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded.cs @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// + /// Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates + /// the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability + /// and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability + /// zones in the primary region. + /// + /// + /// [OpenAPI] CustomerInitiatedMigration=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded : 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 or status associated with an ongoing or enqueued storage account migration in order to update its current + /// SKU or region. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageAccountMigration _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageAccountMigration(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; + + /// current value is 'default' for customer initiated migration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "current value is 'default' for customer initiated migration")] + [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 = @"current value is 'default' for customer initiated migration", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _parametersBody.Name ?? null; set => _parametersBody.Name = 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; } + + /// + /// 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; } + + /// Target sku name for the account + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Target sku name for the 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 = @"Target sku name for the account", + SerializedName = @"targetSkuName", + 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 StorageAccountMigrationDetailTargetSkuName { get => _parametersBody.DetailTargetSkuName; set => _parametersBody.DetailTargetSkuName = value; } + + /// SrpAccountMigrationType in ARM contract which is 'accountMigrations' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "SrpAccountMigrationType in ARM contract which is 'accountMigrations'")] + [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 = @"SrpAccountMigrationType in ARM contract which is 'accountMigrations'", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => _parametersBody.Type ?? null; set => _parametersBody.Type = 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.Api50.IErrorResponseAutoGenerated + /// 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 InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded Clone() + { + var clone = new InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageCustomerStorageAccountInitiatedMigration_CustomerViaIdentityExpanded() + { + + } + + /// 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 'StorageAccountsCustomerInitiatedMigration' 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.StorageAccountsCustomerInitiatedMigrationViaIdentity(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) ); + } + await this.Client.StorageAccountsCustomerInitiatedMigration(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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. + /// + /// 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.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.cs new file mode 100644 index 000000000000..0df04e4d8cc7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IImmutabilityPolicy) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs new file mode 100644 index 000000000000..ec9c967dea75 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", ApiVersion = "2023-05-01")] + 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.Api20230501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.cs new file mode 100644 index 000000000000..0626b566750d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.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_ExtendViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IImmutabilityPolicy) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs new file mode 100644 index 000000000000..a1b26589f179 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", ApiVersion = "2023-05-01")] + 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.Api20230501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs new file mode 100644 index 000000000000..758ee368bd44 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.cs new file mode 100644 index 000000000000..fb9e27c42969 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs new file mode 100644 index 000000000000..7db1142fb723 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.ILeaseContainerRequest _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.Api20230501.ILeaseContainerRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest 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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.cs new file mode 100644 index 000000000000..1ad60ea29726 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", ApiVersion = "2023-05-01")] + 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.Api20230501.ILeaseContainerRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerRequest(); + + /// 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.LeaseContainerRequestAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.cs new file mode 100644 index 000000000000..a529d13985cd --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.ILeaseContainerRequest _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.Api20230501.ILeaseContainerRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.ILeaseContainerRequest 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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs new file mode 100644 index 000000000000..b220e08cc558 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", ApiVersion = "2023-05-01")] + 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.Api20230501.ILeaseContainerRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.LeaseContainerRequest(); + + /// 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.LeaseContainerRequestAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestAction 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs new file mode 100644 index 000000000000..78ededc1f824 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.ILeaseShareRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs new file mode 100644 index 000000000000..01209fbc5afa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease", ApiVersion = "2023-05-01")] + 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.Api20230501.ILeaseShareRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs new file mode 100644 index 000000000000..354ebe1f5b25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.ILeaseShareRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs new file mode 100644 index 000000000000..1dc8ad9423a7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease", ApiVersion = "2023-05-01")] + 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.Api20230501.ILeaseShareRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs new file mode 100644 index 000000000000..b1c6d7c5fe00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs new file mode 100644 index 000000000000..d5ac36dd67fa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs new file mode 100644 index 000000000000..38bf98c9f5c1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// Refreshes any information about the association. + /// + /// [OpenAPI] Reconcile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Refreshes any information about the association.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile : 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 _networkSecurityPerimeterConfigurationName; + + /// The name for Network Security Perimeter configuration + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name for Network Security Perimeter configuration")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name for Network Security Perimeter configuration", + SerializedName = @"networkSecurityPerimeterConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string NetworkSecurityPerimeterConfigurationName { get => this._networkSecurityPerimeterConfigurationName; set => this._networkSecurityPerimeterConfigurationName = 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; } + + /// 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.Api50.IErrorResponseAutoGenerated + /// 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); + + /// + /// (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 InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile Clone() + { + var clone = new InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.NetworkSecurityPerimeterConfigurationName = this.NetworkSecurityPerimeterConfigurationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_Reconcile() + { + + } + + /// 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 'NetworkSecurityPerimeterConfigurationsReconcile' 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.NetworkSecurityPerimeterConfigurationsReconcile(SubscriptionId, ResourceGroupName, AccountName, NetworkSecurityPerimeterConfigurationName, 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,ResourceGroupName=ResourceGroupName,AccountName=AccountName,NetworkSecurityPerimeterConfigurationName=NetworkSecurityPerimeterConfigurationName}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, NetworkSecurityPerimeterConfigurationName=NetworkSecurityPerimeterConfigurationName }) + { + 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, NetworkSecurityPerimeterConfigurationName=NetworkSecurityPerimeterConfigurationName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs new file mode 100644 index 000000000000..4a4eac629797 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// Refreshes any information about the association. + /// + /// [OpenAPI] Reconcile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Refreshes any information about the association.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", ApiVersion = "2023-05-01")] + public partial class InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity : 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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); + + /// + /// (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 InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity Clone() + { + var clone = new InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity() + { + + } + + /// 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 'NetworkSecurityPerimeterConfigurationsReconcile' 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.NetworkSecurityPerimeterConfigurationsReconcileViaIdentity(InputObject.Id, onDefault, 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) ); + } + 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.NetworkSecurityPerimeterConfigurationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NetworkSecurityPerimeterConfigurationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.NetworkSecurityPerimeterConfigurationsReconcile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.NetworkSecurityPerimeterConfigurationName ?? null, 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.cs new file mode 100644 index 000000000000..2fe1984e5697 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.cs new file mode 100644 index 000000000000..134d873aa104 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_Regenerate.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_Regenerate.cs new file mode 100644 index 000000000000..566bfdbd75f1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_Regenerate.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IStorageAccountRegenerateKeyParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..f86f05011b79 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountRegenerateKeyParameters _regenerateKeyBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..b6791fb2f015 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IStorageAccountRegenerateKeyParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..d400e351f3f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountRegenerateKeyParameters _regenerateKeyBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs new file mode 100644 index 000000000000..283b8e5bf715 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs @@ -0,0 +1,1138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountCreateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 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 = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices 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 = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Enables extended group support with local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables extended group support with 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 extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableExtendedGroup { get => _parametersBody.EnableExtendedGroup ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableExtendedGroup = 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.Api20230501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.")] + [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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.")] + [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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction SasPolicyExpirationAction { get => _parametersBody.SasPolicyExpirationAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction)""); set => _parametersBody.SasPolicyExpirationAction = 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.Api20230501.IStorageAccountCreateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..9b5f4f3c75b2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.cs new file mode 100644 index 000000000000..1dcc42826963 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobInventoryPolicy_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobInventoryPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..c420fdeb8034 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageBlobInventoryPolicy_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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobInventoryPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IBlobInventoryPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs new file mode 100644 index 000000000000..968937f3d68c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.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.Api20230501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs new file mode 100644 index 000000000000..b96237dd26b5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserRegeneratePasswordResult + WriteObject((await response).SshPassword); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..2f479aaf3794 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUserRegeneratePasswordResult + WriteObject((await response).SshPassword); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs new file mode 100644 index 000000000000..48647ee5cb2b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs @@ -0,0 +1,586 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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. Properties for NFSv3 enablement and + /// extended groups cannot be set with other properties. + /// + /// + /// [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.Api20230501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Create or update the properties of a local user associated with the storage account. Properties for NFSv3 enablement and extended groups cannot be set with other properties.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", ApiVersion = "2023-05-01")] + 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.Api20230501.ILocalUser _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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; } + + /// + /// Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.")] + [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 ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.", + SerializedName = @"allowAclAuthorization", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowAclAuthorization { get => _propertiesBody.AllowAclAuthorization ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.AllowAclAuthorization = 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// + /// Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Supplementary group membership. Only applicable for local users enabled for NFSv3 access.")] + [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 = @"Supplementary group membership. Only applicable for local users enabled for NFSv3 access.", + SerializedName = @"extendedGroups", + PossibleTypes = new [] { typeof(int) })] + public int[] ExtendedGroup { get => _propertiesBody.ExtendedGroup ?? null /* arrayOf */; set => _propertiesBody.ExtendedGroup = value; } + + /// An identifier for associating a group of users. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An identifier for associating a group of users.")] + [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 identifier for associating a group of users.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(int) })] + public int GroupId { get => _propertiesBody.GroupId ?? default(int); set => _propertiesBody.GroupId = value; } + + /// + /// 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; } } + + /// Indicates if the local user is enabled for access with NFSv3 protocol. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if the local user is enabled for access with NFSv3 protocol.")] + [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 if the local user is enabled for access with NFSv3 protocol.", + SerializedName = @"isNFSv3Enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsNfSv3Enabled { get => _propertiesBody.IsNfSv3Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.IsNfSv3Enabled = 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.Api20230501.IPermissionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..80adf54cef65 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.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; + + /// 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.Api20230501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Sets the managementpolicy to the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IManagementPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IManagementPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..571b3784d152 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", ApiVersion = "2023-05-01")] + 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.Api20230501.IObjectReplicationPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IObjectReplicationPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageQueue_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageQueue_CreateExpanded.cs new file mode 100644 index 000000000000..766a35b2cedc --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageQueue_CreateExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTable_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTable_CreateExpanded.cs new file mode 100644 index 000000000000..9be0cc8320a1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTable_CreateExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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.Api20230501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTaskAssignment_CreateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTaskAssignment_CreateExpanded.cs new file mode 100644 index 000000000000..5d83dede307e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/NewAzStorageTaskAssignment_CreateExpanded.cs @@ -0,0 +1,688 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 task assignment sub-resource with the specified parameters. If a storage task assignment + /// is already created and a subsequent create request is issued with different properties, the storage task assignment properties + /// will be updated. If a storage task assignment 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}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageTaskAssignment_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage task assignment is already created and a subsequent create request is issued with different properties, the storage task assignment properties will be updated. If a storage task assignment 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class NewAzStorageTaskAssignment_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 task assignment. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignment(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Text that describes the purpose of the storage task assignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Text that describes the purpose of the storage task assignment")] + [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 = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _parametersBody.Description ?? null; set => _parametersBody.Description = value; } + + /// Whether the storage task assignment is enabled or not + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Whether the storage task assignment is enabled or not")] + [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 = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _parametersBody.Enabled; set => _parametersBody.Enabled = 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 storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageTaskAssignmentName")] + [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, 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 to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterEndBy { get => _parametersBody.ParameterEndBy ?? default(global::System.DateTime); set => _parametersBody.ParameterEndBy = value; } + + /// + /// Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + public int ParameterInterval { get => _parametersBody.ParameterInterval ?? default(int); set => _parametersBody.ParameterInterval = value; } + + /// + /// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit ParameterIntervalUnit { get => _parametersBody.ParameterIntervalUnit ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); set => _parametersBody.ParameterIntervalUnit = value; } + + /// + /// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartFrom { get => _parametersBody.ParameterStartFrom ?? default(global::System.DateTime); set => _parametersBody.ParameterStartFrom = value; } + + /// + /// When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'")] + [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 to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartOn { get => _parametersBody.ParameterStartOn ?? default(global::System.DateTime); set => _parametersBody.ParameterStartOn = 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; } + + /// The container prefix for the location of storage task assignment report + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The container prefix for the location of storage task assignment report")] + [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 container prefix for the location of storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string ReportPrefix { get => _parametersBody.ReportPrefix ?? null; set => _parametersBody.ReportPrefix = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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 object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor")] + [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 object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetExcludePrefix { get => _parametersBody.TargetExcludePrefix ?? null /* arrayOf */; set => _parametersBody.TargetExcludePrefix = value; } + + /// Required list of object prefixes to be included for task execution + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required list of object prefixes to be included for task execution")] + [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 list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetPrefix { get => _parametersBody.TargetPrefix ?? null /* arrayOf */; set => _parametersBody.TargetPrefix = value; } + + /// Id of the corresponding storage task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the corresponding storage task")] + [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 = @"Id of the corresponding storage task", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + public string TaskId { get => _parametersBody.TaskId ?? null; set => _parametersBody.TaskId = value; } + + /// The trigger type of the storage task assignment execution + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The trigger type of the storage task assignment execution")] + [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 trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => _parametersBody.TriggerType; set => _parametersBody.TriggerType = 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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 NewAzStorageTaskAssignment_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.NewAzStorageTaskAssignment_CreateExpanded Clone() + { + var clone = new NewAzStorageTaskAssignment_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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 NewAzStorageTaskAssignment_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 'StorageTaskAssignmentsCreate' 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.StorageTaskAssignmentsCreate(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.Api20230501.IStorageTaskAssignment + /// 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.Api20230501.IStorageTaskAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_Delete.cs new file mode 100644 index 000000000000..abf7b3cc9514 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_Delete.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.cs new file mode 100644 index 000000000000..fbdccf6c92cb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.cs new file mode 100644 index 000000000000..23b28f697674 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..234394347b6d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs new file mode 100644 index 000000000000..05658cf6ed59 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..8f550e68a18d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs new file mode 100644 index 000000000000..c8a5773aecfa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..893015a9be14 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs new file mode 100644 index 000000000000..fd379ab1d813 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs new file mode 100644 index 000000000000..083a8c7d4d39 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs new file mode 100644 index 000000000000..71c0dc33fe30 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_DeleteViaIdentity.cs new file mode 100644 index 000000000000..447aa8741bb2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageLocalUser_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 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.cs new file mode 100644 index 000000000000..38ecf3b6984b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c702746ab46b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.cs new file mode 100644 index 000000000000..55a771cd7f7d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.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; + + /// + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5eae2bbeaefa --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.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 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs new file mode 100644 index 000000000000..e5a8c11ac211 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.cs new file mode 100644 index 000000000000..0092710c582f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.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_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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_Delete.cs new file mode 100644 index 000000000000..0cd67204195b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_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 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e1384f5283b2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageQueue_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 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageTable_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTable_Delete.cs new file mode 100644 index 000000000000..1c468534e746 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTable_Delete.cs @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageTable_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTable_DeleteViaIdentity.cs new file mode 100644 index 000000000000..d8275d16feb8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTable_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 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_Delete.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_Delete.cs new file mode 100644 index 000000000000..4b8c5d0af5c7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_Delete.cs @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// Delete the storage task assignment sub-resource + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageTaskAssignment_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Delete the storage task assignment sub-resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class RemoveAzStorageTaskAssignment_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; } + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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 storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageTaskAssignmentName")] + [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, 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. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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.Api50.IErrorResponseAutoGenerated + /// 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; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorageTaskAssignment_Delete + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RemoveAzStorageTaskAssignment_Delete Clone() + { + var clone = new RemoveAzStorageTaskAssignment_Delete(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 'StorageTaskAssignmentsDelete' 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.StorageTaskAssignmentsDelete(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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 RemoveAzStorageTaskAssignment_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_DeleteViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_DeleteViaIdentity.cs new file mode 100644 index 000000000000..d948f060c7fe --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RemoveAzStorageTaskAssignment_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + + /// Delete the storage task assignment sub-resource + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageTaskAssignment_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Delete the storage task assignment sub-resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class RemoveAzStorageTaskAssignment_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(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api50.IErrorResponseAutoGenerated + /// 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; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorageTaskAssignment_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RemoveAzStorageTaskAssignment_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorageTaskAssignment_DeleteViaIdentity(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 'StorageTaskAssignmentsDelete' 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.StorageTaskAssignmentsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, 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) ); + } + 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.StorageTaskAssignmentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageTaskAssignmentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageTaskAssignmentsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.StorageTaskAssignmentName ?? 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 RemoveAzStorageTaskAssignment_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.cs new file mode 100644 index 000000000000..a7dd62b2abcf --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.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; + + /// 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.Api20230501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IBlobRestoreParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs new file mode 100644 index 000000000000..38865fc01e94 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobRestoreParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.cs new file mode 100644 index 000000000000..c96295db194a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.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; + + /// 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.Api20230501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IBlobRestoreParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.cs new file mode 100644 index 000000000000..c5c66d861054 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.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; + + /// 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.Api20230501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobRestoreParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IBlobRestoreRange) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs new file mode 100644 index 000000000000..f1a9ba54f7f3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IDeletedShare) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs new file mode 100644 index 000000000000..d1844bd03ce3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", ApiVersion = "2023-05-01")] + 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.Api20230501.IDeletedShare _deletedShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.cs new file mode 100644 index 000000000000..e28f0dd845eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.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; + + /// + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IDeletedShare) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs new file mode 100644 index 000000000000..e89ce73e6f00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", ApiVersion = "2023-05-01")] + 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.Api20230501.IDeletedShare _deletedShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.cs new file mode 100644 index 000000000000..0af1d70efc10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.cs new file mode 100644 index 000000000000..1e60610179de --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.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; + + /// 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.cs new file mode 100644 index 000000000000..60ef924be6b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.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.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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", ApiVersion = "2023-05-01")] + 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.Api20230501.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.Api20230501.IStorageAccountCheckNameAvailabilityParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.cs new file mode 100644 index 000000000000..19ce023492e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountCheckNameAvailabilityParameters _accountNameBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.cs new file mode 100644 index 000000000000..e514595572cb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", ApiVersion = "2023-05-01")] + 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.Api20230501.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.Api20230501.IStorageAccountCheckNameAvailabilityParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.cs new file mode 100644 index 000000000000..6ac6596d334d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountCheckNameAvailabilityParameters _accountNameBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs new file mode 100644 index 000000000000..36a57b83e361 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs @@ -0,0 +1,1016 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 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 = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices 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 = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Enables extended group support with local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables extended group support with 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 extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableExtendedGroup { get => _parametersBody.EnableExtendedGroup ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableExtendedGroup = 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.Api20230501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.")] + [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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.")] + [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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction SasPolicyExpirationAction { get => _parametersBody.SasPolicyExpirationAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction)""); set => _parametersBody.SasPolicyExpirationAction = 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.Api20230501.IStorageAccountUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..50b09e7632b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs @@ -0,0 +1,993 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageAccountUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 false + /// 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 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 = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false 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. Set this property to true for new or existing accounts only if + /// object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false + /// for new accounts to follow best security practices by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices 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 = @"Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object replication policies will involve storage accounts in different AAD tenants. The default interpretation is false for new accounts to follow best security practices by default.", + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Enables extended group support with local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables extended group support with 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 extended group support with local users feature, if set to true", + SerializedName = @"enableExtendedGroups", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableExtendedGroup { get => _parametersBody.EnableExtendedGroup ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableExtendedGroup = 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.Api20230501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. + /// Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.")] + [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, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + 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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' + /// action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that + /// do not adhere to the sas policy expiration period. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.")] + [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 Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction SasPolicyExpirationAction { get => _parametersBody.SasPolicyExpirationAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExpirationAction)""); set => _parametersBody.SasPolicyExpirationAction = 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.Api20230501.IStorageAccountUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.cs new file mode 100644 index 000000000000..5fda0ce3369b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..6f3284ad630d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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.Api20230501.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.Api20230501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.cs new file mode 100644 index 000000000000..8ce2b768ea84 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.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; + + /// + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IEncryptionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs new file mode 100644 index 000000000000..1197e6e02288 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IEncryptionScope _encryptionScopeBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs new file mode 100644 index 000000000000..ac9fbf87edd0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.IEncryptionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs new file mode 100644 index 000000000000..8aa222894e0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IEncryptionScope _encryptionScopeBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs new file mode 100644 index 000000000000..c5bd3b49d2a4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs @@ -0,0 +1,545 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..6017cd377576 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.cs new file mode 100644 index 000000000000..96a216ca7fa1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..2c09a5ac0bcb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", ApiVersion = "2023-05-01")] + 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.Api20230501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.cs new file mode 100644 index 000000000000..15300d40716c --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.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; + + /// 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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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.Api20230501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..31771c5f265b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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.Api20230501.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", ApiVersion = "2023-05-01")] + 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.Api20230501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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.Api20230501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.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.Api20230501.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.Api20230501.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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api20230501.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.Api20230501.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.Api20230501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateExpanded.cs new file mode 100644 index 000000000000..e4bec68c8c6b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateExpanded.cs @@ -0,0 +1,672 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 storage task assignment properties + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageTaskAssignment_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update storage task assignment properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class UpdateAzStorageTaskAssignment_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(); + + /// Parameters of the storage task assignment update request + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateParameters(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Text that describes the purpose of the storage task assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Text that describes the purpose of the storage task assignment")] + [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 = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _parametersBody.Description ?? null; set => _parametersBody.Description = value; } + + /// Whether the storage task assignment is enabled or not + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the storage task assignment is enabled or not")] + [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 = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _parametersBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Enabled = 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 storage task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment 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 task assignment within the specified resource group. Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"storageTaskAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageTaskAssignmentName")] + [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, 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 to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterEndBy { get => _parametersBody.ParameterEndBy ?? default(global::System.DateTime); set => _parametersBody.ParameterEndBy = value; } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + public int ParameterInterval { get => _parametersBody.ParameterInterval ?? default(int); set => _parametersBody.ParameterInterval = value; } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit ParameterIntervalUnit { get => _parametersBody.ParameterIntervalUnit ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); set => _parametersBody.ParameterIntervalUnit = value; } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartFrom { get => _parametersBody.ParameterStartFrom ?? default(global::System.DateTime); set => _parametersBody.ParameterStartFrom = value; } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'")] + [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 to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartOn { get => _parametersBody.ParameterStartOn ?? default(global::System.DateTime); set => _parametersBody.ParameterStartOn = 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; } + + /// The prefix of the storage task assignment report + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The prefix of the storage task assignment report")] + [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 prefix of the storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string ReportPrefix { get => _parametersBody.ReportPrefix ?? null; set => _parametersBody.ReportPrefix = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. 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 object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor")] + [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 object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetExcludePrefix { get => _parametersBody.TargetExcludePrefix ?? null /* arrayOf */; set => _parametersBody.TargetExcludePrefix = value; } + + /// Required list of object prefixes to be included for task execution + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required list of object prefixes to be included for task execution")] + [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 list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetPrefix { get => _parametersBody.TargetPrefix ?? null /* arrayOf */; set => _parametersBody.TargetPrefix = value; } + + /// The trigger type of the storage task assignment execution + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The trigger type of the storage task assignment execution")] + [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 trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => _parametersBody.TriggerType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType)""); set => _parametersBody.TriggerType = 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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 UpdateAzStorageTaskAssignment_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.UpdateAzStorageTaskAssignment_UpdateExpanded Clone() + { + var clone = new UpdateAzStorageTaskAssignment_UpdateExpanded(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 'StorageTaskAssignmentsUpdate' 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.StorageTaskAssignmentsUpdate(SubscriptionId, ResourceGroupName, AccountName, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AccountName=AccountName,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 UpdateAzStorageTaskAssignment_UpdateExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AccountName=AccountName, 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.Api20230501.IStorageTaskAssignment + /// 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.Api20230501.IStorageTaskAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded.cs b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f3e414ee654d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/cmdlets/UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 storage task assignment properties + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageTaskAssignment_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update storage task assignment properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}", ApiVersion = "2023-05-01")] + public partial class UpdateAzStorageTaskAssignment_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(); + + /// Parameters of the storage task assignment update request + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IStorageTaskAssignmentUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.StorageTaskAssignmentUpdateParameters(); + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [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; } + + /// Text that describes the purpose of the storage task assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Text that describes the purpose of the storage task assignment")] + [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 = @"Text that describes the purpose of the storage task assignment", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _parametersBody.Description ?? null; set => _parametersBody.Description = value; } + + /// Whether the storage task assignment is enabled or not + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the storage task assignment is enabled or not")] + [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 = @"Whether the storage task assignment is enabled or not", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _parametersBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Enabled = 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, 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 to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"endBy", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterEndBy { get => _parametersBody.ParameterEndBy ?? default(global::System.DateTime); set => _parametersBody.ParameterEndBy = value; } + + /// + /// Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + public int ParameterInterval { get => _parametersBody.ParameterInterval ?? default(int); set => _parametersBody.ParameterInterval = value; } + + /// + /// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + /// property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 = @"Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"intervalUnit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit ParameterIntervalUnit { get => _parametersBody.ParameterIntervalUnit ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IntervalUnit)""); set => _parametersBody.ParameterIntervalUnit = value; } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property + /// should not be present when ExecutionTrigger.properties.type is 'RunOnce' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'")] + [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 to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'", + SerializedName = @"startFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartFrom { get => _parametersBody.ParameterStartFrom ?? default(global::System.DateTime); set => _parametersBody.ParameterStartFrom = value; } + + /// + /// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property + /// should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'")] + [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 to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when ExecutionTrigger.properties.type is 'OnSchedule'", + SerializedName = @"startOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ParameterStartOn { get => _parametersBody.ParameterStartOn ?? default(global::System.DateTime); set => _parametersBody.ParameterStartOn = 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; } + + /// The prefix of the storage task assignment report + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The prefix of the storage task assignment report")] + [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 prefix of the storage task assignment report", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string ReportPrefix { get => _parametersBody.ReportPrefix ?? null; set => _parametersBody.ReportPrefix = value; } + + /// + /// List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, + /// the exclude prefix will be the determining factor + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor")] + [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 object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes, the exclude prefix will be the determining factor", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetExcludePrefix { get => _parametersBody.TargetExcludePrefix ?? null /* arrayOf */; set => _parametersBody.TargetExcludePrefix = value; } + + /// Required list of object prefixes to be included for task execution + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required list of object prefixes to be included for task execution")] + [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 list of object prefixes to be included for task execution", + SerializedName = @"prefix", + PossibleTypes = new [] { typeof(string) })] + public string[] TargetPrefix { get => _parametersBody.TargetPrefix ?? null /* arrayOf */; set => _parametersBody.TargetPrefix = value; } + + /// The trigger type of the storage task assignment execution + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The trigger type of the storage task assignment execution")] + [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 trigger type of the storage task assignment execution", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType TriggerType { get => _parametersBody.TriggerType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TriggerType)""); set => _parametersBody.TriggerType = 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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 UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded(); + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 'StorageTaskAssignmentsUpdate' 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.StorageTaskAssignmentsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, 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) ); + } + 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.StorageTaskAssignmentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageTaskAssignmentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageTaskAssignmentsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.StorageTaskAssignmentName ?? 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 UpdateAzStorageTaskAssignment_UpdateViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// 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.Api50.IErrorResponseAutoGenerated + /// 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.Api20230501.IStorageTaskAssignment + /// 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.Api20230501.IStorageTaskAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml new file mode 100644 index 000000000000..4d28aa4b2f4f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml @@ -0,0 +1,554 @@ + + + + + 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() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Key + + + Left + Value + + + Left + AppliesTo + + + Left + Scope + + + Left + HelpMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..8271581789c7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml @@ -0,0 +1,471 @@ + + + + + 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.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml new file mode 100644 index 000000000000..2873f28fd663 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml @@ -0,0 +1,306 @@ + + + + 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.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec new file mode 100644 index 000000000000..c7025c12758f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec @@ -0,0 +1,19 @@ + + + + Az.Accounts + 2.13.1 + 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://learn.microsoft.com/powershell/azure/authenticate-azureps + * Added the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 + 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 PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig 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_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig 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 PSCommand_Set-AzConfig + + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 new file mode 100644 index 000000000000..8b322becabf0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 @@ -0,0 +1,389 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 9/20/2023 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.13.1' + +# 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://learn.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.AssemblyLoading.dll', + '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', 'FuzzySharp.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', 'Get-AzConfig', 'Update-AzConfig', + 'Clear-AzConfig', 'Export-AzConfig', 'Import-AzConfig' + +# 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', 'Set-AzConfig' + +# 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 the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 ' + + # 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 +# MIIn0QYJKoZIhvcNAQcCoIInwjCCJ74CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAk2HPcwhsJ45gq +# tueQH3lZy0qaJUF7KlbsF568k8m1kaCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIPqM +# nLtedTpCCZWzygnrN5qjriZa3nvW0MEUhgHrBf/kMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAS7p4ZPALh+4+yJuTQhIPP+LV4A+Jom3lI5qs +# lp7zGTEfbcL8TMbAGgLGl186yuYk/eJlpkSh/cGFRhbcBzQUgXmUfAGnRYugqMXE +# VvX3Qil+ivulxYqiozTr9zWcJ3vitlWIAFJqTTmdHjP0smU7TqrS66Tk06fR4sXU +# x5BVXrlrIismo9vw+sA7wI8LHKwTB61N+w9w2QRDXotckocOV5R/T6ySpCkJfjiP +# V/Ht7VO4JbhDXBedTy9uZ6yQdaBJgmF21iJxacaeYL+StSI/OaHApGTHpJo0/l8K +# UzZmO3S3+sUX3NwAyZ6A4iTM3dGMPFTiEykJD41kS/eAZgy+TaGCFywwghcoBgor +# BgEEAYI3AwMBMYIXGDCCFxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFZBgsqhkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDzkxGA6Q74EKQNCUJRJIpLLx9SAzmpu+DM +# Ytnz01KnYQIGZN5VuexfGBMyMDIzMDkyMDA2MzM0Ni4wMjVaMASAAgH0oIHYpIHV +# MIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQL +# EyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsT +# HVRoYWxlcyBUU1MgRVNOOjA4NDItNEJFNi1DMjlBMSUwIwYDVQQDExxNaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBTZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAGybkAD +# f26plJIAAQAAAbIwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTAwHhcNMjIwOTIwMjAyMjAxWhcNMjMxMjE0MjAyMjAxWjCB0jELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9z +# b2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMqi +# ZTIde/lQ4rC+Bml5f/Wuq/xKTxrfbG23HofmQ+qZAN4GyO73PF3y9OAfpt7Qf2jc +# ldWOGUB+HzBuwllYyP3fx4MY8zvuAuB37FvoytnNC2DKnVrVlHOVcGUL9CnmhDNM +# A2/nskjIf2IoiG9J0qLYr8duvHdQJ9Li2Pq9guySb9mvUL60ogslCO9gkh6FiEDw +# MrwUr8Wja6jFpUTny8tg0N0cnCN2w4fKkp5qZcbUYFYicLSb/6A7pHCtX6xnjqwh +# mJoib3vkKJyVxbuFLRhVXxH95b0LHeNhifn3jvo2j+/4QV10jEpXVW+iC9BsTtR6 +# 9xvTjU51ZgP7BR4YDEWq7JsylSOv5B5THTDXRf184URzFhTyb8OZQKY7mqMh7c8J +# 8w1sEM4XDUF2UZNy829NVCzG2tfdEXZaHxF8RmxpQYBxyhZwY1rotuIS+gfN2eq+ +# hkAT3ipGn8/KmDwDtzAbnfuXjApgeZqwgcYJ8pDJ+y/xU6ouzJz1Bve5TTihkiA7 +# wQsQe6R60Zk9dPdNzw0MK5niRzuQZAt4GI96FhjhlUWcUZOCkv/JXM/OGu/rgSpl +# YwdmPLzzfDtXyuy/GCU5I4l08g6iifXypMgoYkkceOAAz4vx1x0BOnZWfI3fSwqN +# UvoN7ncTT+MB4Vpvf1QBppjBAQUuvui6eCG0MCVNAgMBAAGjggFJMIIBRTAdBgNV +# HQ4EFgQUmfIngFzZEZlPkjDOVluBSDDaanEwHwYDVR0jBBgwFoAUn6cVXQBeYl2D +# 9OXSZacbUzUZ6XIwXwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3JsMGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1l +# LVN0YW1wJTIwUENBJTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUB +# Af8EDDAKBggrBgEFBQcDCDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQAD +# ggIBANxHtu3FzIabaDbWqswdKBlAhKXRCN+5CSMiv2TYa4i2QuWIm+99piwAhDhA +# Dfbqor1zyLi95Y6GQnvIWUgdeC7oL1ZtZye92zYK+EIfwYZmhS+CH4infAzUvscH +# ZF3wlrJUfPUIDGVP0lCYVse9mguvG0dqkY4ayQPEHOvJubgZZaOdg/N8dInd6fGe +# Oc+0DoGzB+LieObJ2Q0AtEt3XN3iX8Cp6+dZTX8xwE/LvhRwPpb/+nKshO7TVuve +# nwdTwqB/LT6CNPaElwFeKxKrqRTPMbHeg+i+KnBLfwmhEXsMg2s1QX7JIxfvT96m +# d0eiMjiMEO22LbOzmLMNd3LINowAnRBAJtX+3/e390B9sMGMHp+a1V+hgs62AopB +# l0p/00li30DN5wEQ5If35Zk7b/T6pEx6rJUDYCti7zCbikjKTanBnOc99zGMlej5 +# X+fC/k5ExUCrOs3/VzGRCZt5LvVQSdWqq/QMzTEmim4sbzASK9imEkjNtZZyvC1C +# sUcD1voFktld4mKMjE+uDEV3IddD+DrRk94nVzNPSuZXewfVOnXHSeqG7xM3V7fl +# 2aL4v1OhL2+JwO1Tx3B0irO1O9qbNdJk355bntd1RSVKgM22KFBHnoL7Js7pRhBi +# aKmVTQGoOb+j1Qa7q+cixGo48Vh9k35BDsJS/DLoXFSPDl4mMIIHcTCCBVmgAwIB +# AgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0 +# IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1 +# WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O +# 1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZn +# hUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t +# 1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxq +# D89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmP +# frVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSW +# rAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv +# 231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zb +# r17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYcten +# IPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQc +# xWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17a +# j54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQAB +# MCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQU +# n6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEw +# QTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9E +# b2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQB +# gjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ +# MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJ +# oEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01p +# Y1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYB +# BQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9v +# Q2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3h +# LB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x +# 5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74p +# y27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1A +# oL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbC +# HcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB +# 9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNt +# yo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3 +# rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcV +# v7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A24 +# 5oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lw +# Y1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB +# 0jELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMk +# TWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAjhJ+EeySRfn2KCNs +# jn9cF9AUSTqggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOi0+i0wIhgPMjAyMzA5MjAxMjU3MTdaGA8yMDIzMDky +# MTEyNTcxN1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA6LT6LQIBADAKAgEAAgIR +# nAIB/zAHAgEAAgIR0DAKAgUA6LZLrQIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBAGjRjrn62VuBz/kNRF8KdoG4YOpoAZu0e3XBc+tcCCiG1Je/ZYXUzMrrq/cz +# MFXWzdmSQRBFPRvcFJw8LcTRu4C6eQOJywts4MMoyE3nJOUUUsOB/i2h2w7L/fo0 +# 3EeEXVTQn/aSK7jkMyysxQEWOw64WNG06Sd08ZDadqbnAc7zMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGybkADf26plJIA +# AQAAAbIwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQgDd3716NLDTxGc+0tAskrKgBsB9PO5RK3smyU +# vyfE7/owgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCBTeM485+E+t4PEVieU +# oFKX7PVyLo/nzu+htJPCG04+NTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABsm5AA39uqZSSAAEAAAGyMCIEILLYuf/URU9tiFRXIhgo +# OAyZuYAFYpFAH2I0pLSN1lWkMA0GCSqGSIb3DQEBCwUABIICAMQZqLlhmv19+CcR +# claEHbZr4MgJjWr2Da27FqRgoOLDtNaS/IZ16UHukAV7JVdIOdVroxfvVdWXh5iq +# dSAfYNMkSBBPxxLbSFnndIw7KWkp3vbxFcJ6+JsK9k54TDZAUP17OpTM11gpTYfm +# uVAWZaqh086moHKLZsjVU/rzFA3En+QY5ZticB0LytwkIY+7pS6ikN4Q3e/pzPLH +# CSa2OZN3bXezZzOWMFLQwJ2IQJLpCKs0RiICTOaOKTpsjcoK2eBLwzXsgnnNZmj/ +# q1XMWGUJbnNJH4mszFVJ6X0cUo3OJvkF9V796VoZZMUS9i0EmCUZNE0rcvPdBnIE +# c8P+QSbLudmDA+XXno2ItqeA1ZkatNLyZGYGSjK4BU48MzcHMkWKCcUlqyfUiJt7 +# 7UGXDTuCzVkqCVVo7XpJNbN7X1oLkh8yTPr5RBbmlzzykIfEkoVnYj4Qc89ohb1N +# qXKDWby0ldBFOZIgyOgRiYJ984yyeAAXvOpTexhDtDCguYGfV56U+NTMve18Oa8u +# IODMD1Nfr+JLHL+J2tkMfZGFa71tGGnI2w9W6xUltjs8XINLrF08szKC6Vlo20wl +# F09Em/cF6qbZ2cnC/BDOt3xDDnJHYOHLR9QCZABbMd7JiuH32PE5C79PbpPYzyje +# p0LB6iM1n1UYaSSFWCx/a3Itdf6/ +# SIG # End signature block diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 new file mode 100644 index 000000000000..2022fcfde49d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 @@ -0,0 +1,365 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 09/20/2023 05:38:15 +# + +$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 + } +} + +# [windows powershell] preload assemblies +if ($PSEdition -eq "Desktop") { + [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::GetAssemblies().Values | ForEach-Object { + $path = $_.Item1 + try { + Add-Type -Path $path -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose "Could not preload $path" + } + } +} + +# [windows powershell] preload module alc assemblies +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +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.") +} + +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"] + } + }) + } + } +} + +[Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper]::RegisterCommandNotFoundAction($ExecutionContext.InvokeCommand) + +# SIG # Begin signature block +# MIInwgYJKoZIhvcNAQcCoIInszCCJ68CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCb9fJw7tRJSjyo +# JEg82Xj/MrcwppXsz44viAgrYDK20aCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIBsLZoT0GL3AfKW+v1FN9bVc +# VG31uoPh0H8hDfNXM1ivMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAjm1RFaOR3jSivggTJhg8Xe4uZwJNAA0kGjYaTLK0sO7bf6gszj9yyZOW +# xl5OXc3I5e8idePoA9U2yMuNyGLP10P/SjCg/FSClm4PZr0HA1ORNDHn85kNLc+7 +# sQMWCkOiYLKNq/TudhmRGfeuEzjeZSiXKGbB65Fr5LeqGAuMNcZ5lKsP4Es7Cavs +# hG+lQd/27Lrb3xnB5LF5FZ9blmjY9UcS0hBnd6x/ynOB4WBFBjsu42fJZz2xx/04 +# panwkiuigz301YvY0maYIiNYJOWaNU32fVM+YX9b7+Iq5plTEx8XhWsexqmQTv9H +# jMkZa/2RkYvkbGfHQ3Ckw/oYI1NydKGCFywwghcoBgorBgEEAYI3AwMBMYIXGDCC +# FxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFZBgsq +# hkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCCehXSh9EH4ZOe8kqIKTs5kjZxVf/mTlUUsukZabtyKDwIGZN/OPZ5t +# GBMyMDIzMDkyMDA1NTAzNS4zNjZaMASAAgH0oIHYpIHVMIHSMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQgSXJl +# bGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNO +# OkQwODItNEJGRC1FRUJBMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBT +# ZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJ +# KoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcNMjIw +# OTIwMjAyMjE5WhcNMjMxMjE0MjAyMjE5WjCB0jELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3Bl +# cmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpEMDgyLTRC +# RkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZTCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIhOFYMzkjWAE9UVnXF9hRGv +# 0xBRxc+I5Hu3hxVFXyK3u38xusEb0pLkwjgGtDsaLLbrlMxqX3tFb/3BgEPEC3L0 +# wX76gD8zHt+wiBV5mq5BWop29qRrgMJKKCPcpQnSjs9B/4XMFFvrpdPicZDv43FL +# gz9fHqMq0LJDw5JAHGDS30TCY9OF43P4d44Z9lE7CaVS2pJMF3L453MXB5yYK/KD +# bilhERP1jxn2yl+tGCRguIAsMG0oeOhXaw8uSGOhS6ACSHb+ebi0038MFHyoTNhK +# f+SYo4OpSY3xP4+swBBTKDoYP1wH+CfxG6h9fymBJQPQZaqfl0riiDLjmDunQtH1 +# GD64Air5k9Jdwhq5wLmSWXjyFVL+IDfOpdixJ6f5o+MhE6H4t31w+prygHmd2UHQ +# 657UGx6FNuzwC+SpAHmV76MZYac4uAhTgaP47P2eeS1ockvyhl9ya+9JzPfMkug3 +# xevzFADWiLRMr066EMV7q3JSRAsnCS9GQ08C4FKPbSh8OPM33Lng0ffxANnHAAX/ +# DE7cHcx7l9jaV3Acmkj7oqir4Eh2u5YxwiaTE37XaMumX2ES3PJ5NBaXq7YdLJwy +# SD+U9pk/tl4dQ1t/Eeo7uDTliOyQkD8I74xpVB0T31/67KHfkBkFVvy6wye21V+9 +# IC8uSD++RgD3RwtN2kE/AgMBAAGjggFJMIIBRTAdBgNVHQ4EFgQUimLm8QMeJa25 +# j9MWeabI2HSvZOUwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXwYD +# VR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9j +# cmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3JsMGwG +# CCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIw +# MjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcD +# CDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQADggIBAF/I8U6hbZhvDcn9 +# 6nZ6tkbSEjXPvKZ6wroaXcgstEhpgaeEwleLuPXHLzEWtuJuYz4eshmhXqFr49lb +# AcX5SN5/cEsP0xdFayb7U5P94JZd3HjFvpWRNoNBhF3SDM0A38sI2H+hjhB/VfX1 +# XcZiei1ROPAyCHcBgHLyQrEu6mnb3HhbIdr8h0Ta7WFylGhLSFW6wmzKusP6aOlm +# nGSac5NMfla6lRvTYHd28rbbCgfSm1RhTgoZj+W8DTKtiEMwubHJ3mIPKmo8xtJI +# WXPnXq6XKgldrL5cynLMX/0WX65OuWbHV5GTELdfWvGV3DaZrHPUQ/UP31Keqb2x +# jVCb30LVwgbjIvYS77N1dARkN8F/9pJ1gO4IvZWMwyMlKKFGojO1f1wbjSWcA/57 +# tsc+t2blrMWgSNHgzDr01jbPSupRjy3Ht9ZZs4xN02eiX3eG297NrtC6l4c/gzn2 +# 0eqoqWx/uHWxmTgB0F5osBuTHOe77DyEA0uhArGlgKP91jghgt/OVHoH65g0QqCt +# gZ+36mnCEg6IOhFoFrCc0fJFGVmb1+17gEe+HRMM7jBk4O06J+IooFrI3e3PJjPr +# Qano/MyE3h+zAuBWGMDRcUlNKCDU7dGnWvH3XWwLrCCIcz+3GwRUMsLsDdPW2OVv +# 7v1eEJiMSIZ2P+M7L20Q8aznU4OAMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJ +# mQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNh +# dGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1 +# WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEB +# BQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjK +# NVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhg +# fWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJp +# rx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/d +# vI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka9 +# 7aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKR +# Hh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9itu +# qBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyO +# ArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItb +# oKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6 +# bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6t +# AgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQW +# BBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacb +# UzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYz +# aHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnku +# aHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIA +# QwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2 +# VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwu +# bWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEw +# LTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYt +# MjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/q +# XBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6 +# U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVt +# I1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis +# 9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTp +# kbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0 +# sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138e +# W0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJ +# sWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7 +# Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0 +# dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQ +# tB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxh +# bmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpE +# MDgyLTRCRkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vy +# dmljZaIjCgEBMAcGBSsOAwIaAxUAdqNHe113gCJ87aZIGa5QBUqIwvKggYMwgYCk +# fjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIF +# AOi0eZswIhgPMjAyMzA5MjAwMzQ4NDNaGA8yMDIzMDkyMTAzNDg0M1owdzA9Bgor +# BgEEAYRZCgQBMS8wLTAKAgUA6LR5mwIBADAKAgEAAgIL+AIB/zAHAgEAAgIULDAK +# AgUA6LXLGwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIB +# AAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBAClyBBu79vwaDEgr +# sDdtLY+7se9ISbk8pveb65oGP9gabWe8mNnqfg1SxEN1eW2I4ihQvT2bQVBGeDi7 +# wVO+vcDBDl/uDAaYT7wKES/l/PJORKyBmUoDGFoLJT7bHa+uqFek2mjsC8RIlpdj +# oVOh5HQksZd5HgNF4K/uv2nUyKuEMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTACEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJYIZIAWUD +# BAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0B +# CQQxIgQgbjk/IiL8KyUtICVXFblxmt8j6F3g0s6KsH+WJzhAIqAwgfoGCyqGSIb3 +# DQEJEAIvMYHqMIHnMIHkMIG9BCApVb08M25w+tYGWsmlGtp1gy1nPcqWfqgMF3nl +# WYVzBTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9u +# MRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRp +# b24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB +# uh8/GffBdb18AAEAAAG6MCIEIJ9hCOdmkSHZdWHnjcQBaILiGo+/uNr71agjiWaN +# bF2dMA0GCSqGSIb3DQEBCwUABIICACgD9Dbo/LkUWEGprq7D+RTXofFwwH6qSKeh +# N1y8UNvmYAtF83AuC2amIWELSmnnblZEv1sMvjteyyLsLRuid8la04mjjLUBduUN +# yGhij+4aarTuuVuwf/Ap273AGk1mv3slKF3R7lQnObcO4SEXYYoDeBDY/HI8Pa3g +# 6FkNw18RsDp3Atj0Eun/UZaL+XCNHPJCsLoEK69bz9cxhiEwQfcEhc9kDzKTqjZV +# Yla/8Qh+WoC/0uQz1lEpQvP4vrSVOXw89ZGUicwjRHZ3Oys2IgPu5vrG3BeFZNCO +# q3ieylUYWrOBvIxZQWcHR5tqmwdQDnUHRR6vZNVxqErZ0dLdd824gFoKGUbup0MG +# SdD/k2nffp38SFvsfiDiO6DRwt49LX5ClzxeXt4LFv9GTNq4/9vlInIQoi9BujGg +# 3vJIDEVxEDZzq//guGDkz1ybPLz3/hrSzySBD5YWaVtcqapTPGMxqSOcwjFD9AbY +# 5BYD0o6/0lXAIBQVLCI4elTZToeECLJkkerZA79OU9UJFL6cdrr5s6KENdLQkXIO +# o3M2KywJgUYUVK4v2mSeUzyahW3XW0+i5K03EPAlDi4ONFZZSE5l73er2SziU0go +# a8R5O6oYM6AAPmSBTX/6EpF1vb5fkPfOSI3nBe1TBlovGg3WvWQGn9Ft5B/kSq6F +# MXMUpngZ +# SIG # End signature block diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll new file mode 100644 index 000000000000..d25fb236c3e9 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..8ef5eef2989d Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll new file mode 100644 index 000000000000..38f5f8542077 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..77cc1c46f5a7 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..d8429b2b6881 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..1503a5b6d3ac Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..acc0eb23524f Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..1d35ab395d17 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..3ab15df83c30 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..4b6131e2a0f6 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..b5c2285f8237 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..afd56a7b9208 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b6838bea7093 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..d28204acd31a Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..b35c96f4c5cb Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..3a37aeb3a3d5 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..6b3270044fbc Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..eaa53e5a4ac9 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..947ac62a5ac0 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..f2f380543ee1 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..07d9948aca17 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,13631 @@ + + + + + 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. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + 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. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + 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://learn.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzConfig + Clear + AzConfig + + Clears the values of configs that are set by the user. + + + + Clears the values of configs that are set by the user. By default all the configs will be cleared. You can also specify keys of configs to clear. + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + 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 + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + 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 + + + Force + + Do not ask for confirmation when clearing all configs. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + 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 + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Force + + Do not ask for confirmation when clearing all configs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + 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-AzConfig -Force + + Clear all the configs. `-Force` suppresses the prompt for confirmation. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzConfig -EnableDataCollection + + Clear the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azconfig + + + + + + 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://learn.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://learn.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 + $SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecurePassword +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 +Set-AzContext -Subscription Subscription1 + +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 = ConvertTo-SecureString -String "Password123!" -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 + + + + + + + + --------- Example 10: Connect interactively using WAM --------- + Update-AzConfig -EnableLoginByWam $true +Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://learn.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 -------------------------- + Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.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://learn.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://learn.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://learn.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://learn.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 -------------------------- + Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.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://learn.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://learn.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Export-AzConfig + Export + AzConfig + + Exports all the configs into a file so that it can be imported on another machine. + + + + The `Export-AzConfig` cmdlet exports all the configs that are set at the "CurrentUser" scope into a file at given path in JSON format. The file can then be imported by `Import-AzConfig` for example on another machine. + + + + Export-AzConfig + + Path + + Specifies the path of the file to which to save the configs. + + 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 + + + Force + + Overwrites the given file if it exists. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + + 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 + + + Force + + Overwrites the given file if it exists. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save the configs. + + 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.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Export-AzConfig -Path ./config.json + + This example exports the configs to `./config.json` file which can later be imported via `Import-AzConfig`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/export-azconfig + + + Import-AzConfig + + + + + + + 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. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + 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://learn.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzConfig + Get + AzConfig + + Gets the configs of Azure PowerShell. + + + + Gets the configs of Azure PowerShell. By default it lists all the configs. You can filter the result using various parameters. + > [!NOTE] > Configs have priorities. Generally speaking, Process scope has higher priority than CurrentUser scope; a config that applies to a certain cmdlet has higher priority than that applies to a module, again higher than Az. > To reduce confusion, the result of `Get-AzConfig` shows those configs that are taking effect. It is a combination of all the configs, but not literally all the configs. However, you could always view them by applying different filter parameters, such as `-Scope`. + + + + Get-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzConfig + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… +DefaultSubscriptionForLogin Az Default Subscription name or GUID. Sets the default context for Azure PowerShell when logging in with… +DisplayBreakingChangeWarning True Az Default Controls if warning messages for breaking changes are displayed or suppressed. When enabled, … + + Gets all the configs. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzConfig -EnableDataCollection + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… + + Gets the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azconfig + + + + + + 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://learn.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://learn.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://learn.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. `GalleryUrl` will be removed from ArmMetadata and so Azure PowerShell will no longer provide for its value in `PSAzureEnvironment`. Currently `GalleryUrl` is not used in Azure PowerShell products. Please do not reply on `GalleryUrl` anymore. + + + + 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 +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://learn.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 -TenantId (Get-AzContext).Tenant + +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://learn.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://learn.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzConfig + Import + AzConfig + + Imports configs from a file that was previously exported by `Export-AzConfig`. + + + + The `Import-AzConfig` cmdlet imports all the configs from a file that was previously exported by `Export-AzConfig`. The imported configs will be set at the "CurrentUser" scope, so they are consistent across PowerShell sessions. + During importing, if a config that is to be imported has already been set, its value will be overwritten. + + + + Import-AzConfig + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + 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 + + + PassThru + + Returns a boolean value indicating success or failure. + + + 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 + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + 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.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Import-AzConfig -Path ./config.json + + This example imports configs from file `./config.json`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/import-azconfig + + + Export-AzConfig + + + + + + + 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://learn.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`. + + + + + + -------------------------- Example 3 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring,apps -Name "test-spring-service" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"value":[{"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioni + ngState":"Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOn + ly":false,"createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"pers + istentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity + ":null,"location":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"},{"properties":{"publ + ic":false,"provisioningState":"Succeeded","activeDeploymentName":"deploy01","fqdn":"test-spring-service.azuremicr + oservices.io","httpsOnly":false,"createdTime":"2022-06-22T07:46:54.9Z","temporaryDisk":{"sizeInGB":5,"moun + tPath":"/tmp"},"persistentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Sp + ring/apps","identity":null,"location":"eastus","id":"/subscriptions/$subscriptionId/r + esourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/pwsh01","name":"pwsh0 + 1"}]} + + List apps under spring service "test-spring-service" + + + + + + -------------------------- Example 4 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring -Name "test-spring-service","demo" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioningState":" + Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOnly":false, + "createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"persistentDisk + ":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity":null,"lo + cation":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/pr + oviders/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"} + + Get app "demo" under Spring cloud service "test-spring-service" + + + + + + + + Online Version: + https://learn.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://learn.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://learn.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://learn.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://learn.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://learn.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://learn.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://learn.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 -------------------------- + Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://learn.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://learn.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://learn.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://learn.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. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + 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. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + 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://learn.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://learn.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + + + Update-AzConfig + Update + AzConfig + + Updates the configs of Azure PowerShell. + + + + Updates the configs of Azure PowerShell. Depending on which config to update, you may specify the scope where the config is persisted and to which module or cmdlet it applies to. + > [!NOTE] > It is discouraged to update configs in multiple PowerShell processes. Either do it in one process, or make sure the updates are at Process scope (`-Scope Process`) to avoid unexpected side-effects. + + + + Update-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + 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 + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + 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 + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + 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.Boolean + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Update-AzConfig -DefaultSubscriptionForLogin "Name of subscription" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DefaultSubscriptionForLogin Name of subscription Az CurrentUser Subscription name or GUID. Sets the default context for Azure PowerShell when lo… + + Sets the "DefaultSubscriptionForLogin" config as "Name of subscription". When `Connect-AzAccount` the specified subscription will be selected as the default subscription. + + + + + + -------------------------- Example 2 -------------------------- + Update-AzConfig -DisplayBreakingChangeWarning $false -AppliesTo "Az.KeyVault" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DisplayBreakingChangeWarning False Az.KeyVault CurrentUser Controls if warning messages for breaking changes are displayed or suppressed. When enabled,… + + Sets the "DisplayBreakingChangeWarnings" config as "$false" for "Az.KeyVault" module. This prevents all the warning messages for upcoming breaking changes in Az.KeyVault module from prompting. + + + + + + -------------------------- Example 3 -------------------------- + Update-AzConfig -EnableDataCollection $true + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection True Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experi… + + Sets the "EnableDataCollection" config as "$true". This enables sending the telemetry data. Setting this config is equivalent to `Enable-AzDataCollection` and `Disable-AzDataCollection`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/update-azconfig + + + + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..3d53eaa669dc Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..2443eb5dd56a Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..a163f556b3f8 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..0ccbb5ead102 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..a4fca7488baf Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..1a6de8a08d69 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,222 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIC8M +# Xy0xGn+XGeN5xhSUhsVdQGTLtuHOS5+U3UgQ1k53MEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAf/y9IwVq9QTOrbQE7i6AVISmUE6gxgH9PaqX +# D6xL8+9cpj9Y6/kfZ6Zw1Z04+XY4c5dhmIJuWcRjx+i5yXFmp0fyaDfNpalcQlJv +# 1yplKVfyAsVpod7RIH4YvrwP2c/gvYSLRF9k1a/QyIT4yTfPFGaR42tZ0MAyWHhz +# t5ZdXN3dPJt865YoEzv7pPZN29w4mjfr78s6XxeYYARLHPdw/rChVioeia9TyNl9 +# QCKfm9Kar9oDLel2pMgRuonn40KhF85e93XvVLO1PMGXzljlkGWY7PmHuXiOJeyS +# xOe/+p56sTLtL2yIjl/8SDLVGi7LJ7Y93hQGv9yd8U9Tio/mVqGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCAkPO6Va7JVENY1DGO3Rgl+LBuXva2N4CJh +# CxPTspOx1QIGZQP2LMVBGBMyMDIzMDkyMDA1NTA0NC41MDZaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046OEQwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAc1VByrnysGZHQAB +# AAABzTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMDVaFw0yNDAyMDExOTEyMDVaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046OEQwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDTOCLVS2jmEWOqxzygW7s6 +# YLmm29pjvA+Ch6VL7HlTL8yUt3Z0KIzTa2O/Hvr/aJza1qEVklq7NPiOrpBAIz65 +# 7LVxwEc4BxJiv6B68a8DQiF6WAFFNaK3WHi7TfxRnqLohgNz7vZPylZQX795r8MQ +# vX56uwjj/R4hXnR7Na4Llu4mWsml/wp6VJqCuxZnu9jX4qaUxngcrfFT7+zvlXCl +# wLah2n0eGKna1dOjOgyK00jYq5vtzr5NZ+qVxqaw9DmEsj9vfqYkfQZry2JO5wmg +# XX79Ox7PLMUfqT4+8w5JkdSMoX32b1D6cDKWRUv5qjiYh4o/a9ehE/KAkUWlSPbb +# DR/aGnPJLAGPy2qA97YCBeeIJjRKURgdPlhE5O46kOju8nYJnIvxbuC2Qp2jxwc6 +# rD9M6Pvc8sZIcQ10YKZVYKs94YPSlkhwXwttbRY+jZnQiDm2ZFjH8SPe1I6ERcfe +# YX1zCYjEzdwWcm+fFZmlJA9HQW7ZJAmOECONtfK28EREEE5yzq+T3QMVPhiEfEhg +# cYsh0DeoWiYGsDiKEuS+FElMMyT456+U2ZRa2hbRQ97QcbvaAd6OVQLp3TQqNEu0 +# es5Zq0wg2CADf+QKQR/Y6+fGgk9qJNJW3Mu771KthuPlNfKss0B1zh0xa1yN4qC3 +# zoE9Uq6T8r7G3/OtSFms4wIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFKGT+aY2aZrB +# AJVIZh5kicokfNWaMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQBSqG3ppKIU+i/E +# MwwtotoxnKfw0SX/3T16EPbjwsAImWOZ5nLAbatopl8zFY841gb5eiL1j81h4DiE +# iXt+BJgHIA2LIhKhSscd79oMbr631DiEqf9X5LZR3V3KIYstU3K7f5Dk7tbobuHu +# +6fYM/gOx44sgRU7YQ+YTYHvv8k4mMnuiahJRlU/F2vavcHU5uhXi078K4nSRAPn +# WyX7gVi6iVMBBUF4823oPFznEcHup7VNGRtGe1xvnlMd1CuyxctM8d/oqyTsxwlJ +# AM5F/lDxnEWoSzAkad1nWvkaAeMV7+39IpXhuf9G3xbffKiyBnj3cQeiA4SxSwCd +# nx00RBlXS6r9tGDa/o9RS01FOABzKkP5CBDpm4wpKdIU74KtBH2sE5QYYn7liYWZ +# r2f/U+ghTmdOEOPkXEcX81H4dRJU28Tj/gUZdwL81xah8Kn+cB7vM/Hs3/J8tF13 +# ZPP+8NtX3vu4NrchHDJYgjOi+1JuSf+4jpF/pEEPXp9AusizmSmkBK4iVT7NwVtR +# nS1ts8qAGHGPg2HPa4b2u9meueUoqNVtMhbumI1y+d9ZkThNXBXz2aItT2C99DM3 +# T3qYqAUmvKUryVSpMLVpse4je5WN6VVlCDFKWFRH202YxEVWsZ5baN9CaqCbCS0E +# a7s9OFLaEM5fNn9m5s69lD/ekcW2qTCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOjhEMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQBoqfem2KKzuRZjISYifGolVOdyBKCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRjDzAi +# GA8yMDIzMDkxOTE4MTIzMVoYDzIwMjMwOTIwMTgxMjMxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotGMPAgEAMAoCAQACAhpaAgH/MAcCAQACAhNWMAoCBQDotbSP +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBALTbRIUnATvJxQER3PTF/m7f +# ea2mmC38vdy89JNDWbAETiN+HOhqZRgyGz1otnOANH++7NjRRSrh8byXARE8w1dN +# AVpbbjDea3JZt2zTkA6uRN/vjuifXHSz470WR6P8Mm3KhMtOK4AYLam5Xe1bnjAv +# JU02cI0r1MUOqkWJa/2Il+9Dm1raxizVGFUvgSLHDgxpFgfins0MBOg4RQTpRDIP +# arFUPTmbFhZfTBa2DAiHGcy9hPO1pNUY3FKdAMYkRxt9CAodlmkueGu6oiSxRd3M +# TPqGHQx9pJzJuE6yM0SZO/J0O5PnHIRc7RMdy0XikWk8D3SmDYFQOOxk7noeloYx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# Ac1VByrnysGZHQABAAABzTANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCDMuF7QDQHme8LEs4NWCnOa +# 8jbgJtGZELxoEEYiDH+efzCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIOJm +# pfitVr1PZGgvTEdTpStUc6GNh7LNroQBKwpURpkKMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHNVQcq58rBmR0AAQAAAc0wIgQgpXNo +# CR5udEHFtsK4vRweYQG6+tUY8EhPATlSEIELPDswDQYJKoZIhvcNAQELBQAEggIA +# iFTcLZ0vwFJzK+Rqanq7AynGwJuFJLGY6whQgWb+a8jLVtlCBrd5w36Xa3DfTbUO +# KSNVOq3JahGUSLZwnfm69YOiH8xujOMozBs7lgnTwoEfFchjFhGxMUxjC7YVuqph +# 82Q6e/qzSHMhNsbVoL7G/EA9lGIQ2rjxiREnh5IbiAvrrYyYrIHUGux7U/gXUE3W +# UzXMCNAuQrAXgC1I4CRfv8gRR1D1Zf27juawIsubcJ+X4NsHsrZlUChB4Jvcli5U +# +0BHtqXZl0jesLtdnxXcZQrZR8N5yMAr+J9ozW4F5l/Nw/K3JO/5XeR3tGjTpKWT +# qd9YPyvhJpn7WJGeOb60ahoyNkCPjdJXCfx7tMRYztCzlQVkqsbZmaWXAOPBpCJy +# KJW7TTHceNGuQxTbZ62LPX+3X+Li0I5QL+fN/CyvajxlbkONe6p7mEO1GwyEoBHK +# aK7p3pH45Fyn9pedZpWRnwNKFCtm7xIGrjD8dwh/SKnQQn0UZCOm6Z2MTA2dexh5 +# tckF0e9H6wsS2ty7bQjaxuIu7bRVIOv7N58yLZvZ/JpjuxTXTxJuxPmlAsBq4DPk +# 6oHV7zY0K9mbyoGUw0Hie5ZW+i15UGOQYjt9ORg38GLgv4mt3o4v78J0X1HTWDGt +# IKZzmt/ZsnE2gTde52Wujm56LnstUoCXuTKlLP5MTGA= +# SIG # End signature block diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..5379b99cf34a --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 @@ -0,0 +1,281 @@ +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 +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIKR+ +# w/DaLVp8ra2PXQQVXZI6DyW6fyW+fzmibTR/vTxzMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAAJ/05iL6/mTJTdXlA3WMNU7DPdukKaJDMocn +# pzyB1C0hLB0o81xP7YSAsUBDAKzunfQ+oBNu6n/owxsHxw8C5aiDdeX87DkrwFEN +# 6Y0/kc3H3LpC+ll1Aq78ia85raDdogkMJNqAZOpaSs/+WPQGmTqATI3FTxjzviyB +# W2d09blFshgmPNB4IKNWZrf0xAZjugWcVe7WjbSnrf9C6Uap/yfFjAm1D+Am86Dy +# 9UYWjaxYSdiYj39a4rawSz2+47doMiSNWEdRzLBWQ3mhzG79emCceHwhCMof3KYZ +# WbXjXm+C738l48ZuzZ50X/w2B7jWQCLLiIdIY0Nczh9n7W+R8qGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDTxg5YDL/sFFSkwNmajR/hD+zpUa9/iONc +# c1T6Gn07AgIGZQPtxMFeGBMyMDIzMDkyMDA1NTA0My40MTNaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046QTAwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAdB3CKrvoxfG3QAB +# AAAB0DANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMTRaFw0yNDAyMDExOTEyMTRaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046QTAwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDfMlfn35fvM0XAUSmI5qiG +# 0UxPi25HkSyBgzk3zpYO311d1OEEFz0QpAK23s1dJFrjB5gD+SMw5z6EwxC4CrXU +# 9KaQ4WNHqHrhWftpgo3MkJex9frmO9MldUfjUG56sIW6YVF6YjX+9rT1JDdCDHbo +# 5nZiasMigGKawGb2HqD7/kjRR67RvVh7Q4natAVu46Zf5MLviR0xN5cNG20xwBwg +# ttaYEk5XlULaBH5OnXz2eWoIx+SjDO7Bt5BuABWY8SvmRQfByT2cppEzTjt/fs0x +# p4B1cAHVDwlGwZuv9Rfc3nddxgFrKA8MWHbJF0+aWUUYIBR8Fy2guFVHoHeOze7I +# sbyvRrax//83gYqo8c5Z/1/u7kjLcTgipiyZ8XERsLEECJ5ox1BBLY6AjmbgAzDd +# Nl2Leej+qIbdBr/SUvKEC+Xw4xjFMOTUVWKWemt2khwndUfBNR7Nzu1z9L0Wv7TA +# Y/v+v6pNhAeohPMCFJc+ak6uMD8TKSzWFjw5aADkmD9mGuC86yvSKkII4MayzoUd +# seT0nfk8Y0fPjtdw2Wnejl6zLHuYXwcDau2O1DMuoiedNVjTF37UEmYT+oxC/OFX +# UGPDEQt9tzgbR9g8HLtUfEeWOsOED5xgb5rwyfvIss7H/cdHFcIiIczzQgYnsLyE +# GepoZDkKhSMR5eCB6Kcv/QIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFDPhAYWS0oA+ +# lOtITfjJtyl0knRRMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCXh+ckCkZaA06S +# NW+qxtS9gHQp4x7G+gdikngKItEr8otkXIrmWPYrarRWBlY91lqGiilHyIlZ3iNB +# UbaNEmaKAGMZ5YcS7IZUKPaq1jU0msyl+8og0t9C/Z26+atx3vshHrFQuSgwTHZV +# pzv7k8CYnBYoxdhI1uGhqH595mqLvtMsxEN/1so7U+b3U6LCry5uwwcz5+j8Oj0G +# UX3b+iZg+As0xTN6T0Qa8BNec/LwcyqYNEaMkW2VAKrmhvWH8OCDTcXgONnnABQH +# BfXK/fLAbHFGS1XNOtr62/iaHBGAkrCGl6Bi8Pfws6fs+w+sE9r3hX9Vg0gsRMoH +# RuMaiXsrGmGsuYnLn3AwTguMatw9R8U5vJtWSlu1CFO5P0LEvQQiMZ12sQSsQAkN +# DTs9rTjVNjjIUgoZ6XPMxlcPIDcjxw8bfeb4y4wAxM2RRoWcxpkx+6IIf2L+b7gL +# HtBxXCWJ5bMW7WwUC2LltburUwBv0SgjpDtbEqw/uDgWBerCT+Zty3Nc967iGaQj +# yYQH6H/h9Xc8smm2n6VjySRx2swnW3hr6Qx63U/xY9HL6FNhrGiFED7ZRKrnwvvX +# vMVQUIEkB7GUEeN6heY8gHLt0jLV3yzDiQA8R8p5YGgGAVt9MEwgAJNY1iHvH/8v +# zhJSZFNkH8svRztO/i3TvKrjb8ZxwjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkEwMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQC8t8hT8KKUX91lU5FqRP9Cfu9MiaCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LUDNzAi +# GA8yMDIzMDkyMDA1MzU1MVoYDzIwMjMwOTIxMDUzNTUxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotQM3AgEAMAoCAQACAidSAgH/MAcCAQACAhN/MAoCBQDotlS3 +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBAGtIWKlQ4xjkBGBgoktG9bqb +# W3uOsn29c3JcnP5Eq5RSCeHwCRLqC6bYPnrI0V6uJZGaSe/UiVRIjbQsr2Md6Liu +# 18E+/l27E3rd5NKZ4JapQ+nadT7roP/Q2NkZ+hK8kYvV+j0C2aCVDxM6KKvyfXN3 +# 9vIyVoMXXa4Htf6H6hiqbvBelUMohEcS20RXmTcQgBz/4JqhqXiIJBid/2SRudEp +# P4FKC/q7NZu0Kt9vaka5bpOjFkH8DSdsTmNhCnMsz3k60iD9L7fzqu6bIkCGeO9K +# urvs0V5kghKnZiJZ37Bwtng7KlequE58NxNKkuZrEiwepGU/NMZpgCsT31R2Qgwx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# AdB3CKrvoxfG3QABAAAB0DANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCA5XwcAA1GbklJPMnjaBqpF +# NIgNrpeBP842Vo44Tv3PxTCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIAiV +# QAZftNP/Md1E2Yw+fBXa9w6fjmTZ5WAerrTSPwnXMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHQdwiq76MXxt0AAQAAAdAwIgQgqB/y +# toAW0gc8cem4mHJrpEhQ7NI8Dpr/F6zncI8TlJUwDQYJKoZIhvcNAQELBQAEggIA +# q2johekNXCez3sHPgTENMweCsqyCVgtTV3YML+gpr56aV2vz+Iuy6Bt+8tatbyVW +# ANUYA8RkAftW+u/VvBBJUl0Y/83/DHph0XoaHq0MAZ9zbVWUqU5bcocF4IbZnik9 +# rA86SRXqOrPIK/i4J2vY7dWdPdhV6C8E2jBL0Lx/qiunv2BZy4DfptkRznVY5eRG +# jOcAhlr0s20DS1ylsIuGNf1bloA5Cldc+ObtGVglNPXLKD50YKsCIl4zshQEwubA +# 42PPlGpDcH8JfZAH/ckamL/wQhCi4UdZlVR7NVSMJ19oDlV3Y2ybLw7pVs6UJsqi +# DSzEdW+634lbvORxEWsOeok0J1tlgjjUGhPjMdFh/96qcqPnInvHqvYOcmVUFfYL +# HnquWfMQxvcHyLni96fLcsfGDGsUaNNjSx4vmaIYJknwCadjHIJyChjhYNQb00bz +# aHP6UJDZf2ZcRhuaKdMGV3lWH2Wens4zDgoYSW0iES9FkqIHGh3vy2knZ2CDrY7w +# BdB8PrTm9I7XVen1DEeXtoLusGLn08Jf9UnSXoBq6hptFUJi718OsfXPN26u9/3M +# IKxkdPyvj7pir1X9GaZMyz6eCGJGGtoaBPWAYrJHXoPq/zwpRiGcbK+PLkfI8PRb +# G5flQxQzxdP1hSzAqqE+VCto96sLhASeMZ7gpL87UoQ= +# SIG # End signature block diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..f03e9ec7eb08 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,242 @@ +$assemblyRootPath = [System.IO.Path]::Combine($PSScriptRoot, "..", "lib") +Write-Debug "Initializing ConditionalAssemblyContext. PSEdition is [$($PSVersionTable.PSEdition)]. PSVersion is [$($PSVersionTable.PSVersion)]." +$conditionalAssemblyContext = [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyContext]::new($PSVersionTable.PSEdition, $PSVersionTable.PSVersion) +Write-Debug "Initializing ConditionalAssemblyProvider. AssemblyRootPath is [$assemblyRootPath]." +[Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::Initialize($assemblyRootPath, $conditionalAssemblyContext) + +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 + Write-Debug "Registering Az shared AssemblyLoadContext." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext() + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCAe8RL2QVOwrz6 +# penupFKMe0U4FkbIX5RGfbRRPsEAcqCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGgowghoGAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIMHofDlPBqmVqK1okjwWVgBB +# tT7fuKbvz/K2Z2tehrjfMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAh6WOd8mYDPLLkfaNOj1I07laB0TnfUoY3kPU8nRKXndoULPuXHTw+0TR +# ZwgvCjxyErXrV6Gpd03Xy2YcKFMOT5DHY8iV0olxkvZNHTt0oMmIUjYyCkblV3PA +# nrDZGbmmxw3FKRT/n2bQ9SNj7PNl29HgNxQxlDSEl6yJP+Bs11pyfW5uNYNVFPIj +# M5ddEr31Z9y/SwJ0oB892Anu6ZT2Cqy6Xt5XIacqNVpWG00UUVguvrHdelkLF4g4 +# dgI+UROhJfNfXgkmazGilBrufCC3LFe46BZgY3kJavyni3F3qsAujcb8+0QXczTu +# 9omGeP+6mHTHBR+9gPJW9pp+0x6O96GCF5QwgheQBgorBgEEAYI3AwMBMYIXgDCC +# F3wGCSqGSIb3DQEHAqCCF20wghdpAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFSBgsq +# hkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCDB/5pgJMSywQWzPV9JmKhJL6MoNIaXQMIgMZkbopcpUAIGZQQDsMbk +# GBMyMDIzMDkyMDA1NTA0NC4xNTJaMASAAgH0oIHRpIHOMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Wg +# ghHqMIIHIDCCBQigAwIBAgITMwAAAdIhJDFKWL8tEQABAAAB0jANBgkqhkiG9w0B +# AQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAeFw0yMzA1MjUxOTEy +# MjFaFw0yNDAyMDExOTEyMjFaMIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25z +# MScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0wNUUwLUQ5NDcxJTAjBgNV +# BAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDcYIhC0QI/SPaT5+nYSBsSdhBPO2SXM40Vyyg8Fq1T +# PrMNDzxChxWUD7fbKwYGSsONgtjjVed5HSh5il75jNacb6TrZwuX+Q2++f2/8CCy +# u8TY0rxEInD3Tj52bWz5QRWVQejfdCA/n6ZzinhcZZ7+VelWgTfYC7rDrhX3TBX8 +# 9elqXmISOVIWeXiRK8h9hH6SXgjhQGGQbf2bSM7uGkKzJ/pZ2LvlTzq+mOW9iP2j +# cYEA4bpPeurpglLVUSnGGQLmjQp7Sdy1wE52WjPKdLnBF6JbmSREM/Dj9Z7okxRN +# UjYSdgyvZ1LWSilhV/wegYXVQ6P9MKjRnE8CI5KMHmq7EsHhIBK0B99dFQydL1vd +# uC7eWEjzz55Z/DyH6Hl2SPOf5KZ4lHf6MUwtgaf+MeZxkW0ixh/vL1mX8VsJTHa8 +# AH+0l/9dnWzFMFFJFG7g95nHJ6MmYPrfmoeKORoyEQRsSus2qCrpMjg/P3Z9WJAt +# FGoXYMD19NrzG4UFPpVbl3N1XvG4/uldo1+anBpDYhxQU7k1gfHn6QxdUU0TsrJ/ +# JCvLffS89b4VXlIaxnVF6QZh+J7xLUNGtEmj6dwPzoCfL7zqDZJvmsvYNk1lcbyV +# xMIgDFPoA2fZPXHF7dxahM2ZG7AAt3vZEiMtC6E/ciLRcIwzlJrBiHEenIPvxW15 +# qwIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFCC2n7cnR3ToP/kbEZ2XJFFmZ1kkMB8G +# A1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRYMFYwVKBSoFCG +# Tmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY3Jvc29mdCUy +# MFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEFBQcBAQRgMF4w +# XAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2Vy +# dHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwG +# A1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQD +# AgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCw5iq0Ey0LlAdz2PcqchRwW5d+fitNISCv +# qD0E6W/AyiTk+TM3WhYTaxQ2pP6Or4qOV+Du7/L+k18gYr1phshxVMVnXNcdjecM +# tTWUOVAwbJoeWHaAgknNIMzXK3+zguG5TVcLEh/CVMy1J7KPE8Q0Cz56NgWzd9ur +# G+shSDKkKdhOYPXF970Mr1GCFFpe1oXjEy6aS+Heavp2wmy65mbu0AcUOPEn+hYq +# ijgLXSPqvuFmOOo5UnSV66Dv5FdkqK7q5DReox9RPEZcHUa+2BUKPjp+dQ3D4c9I +# H8727KjMD8OXZomD9A8Mr/fcDn5FI7lfZc8ghYc7spYKTO/0Z9YRRamhVWxxrIsB +# N5LrWh+18soXJ++EeSjzSYdgGWYPg16hL/7Aydx4Kz/WBTUmbGiiVUcE/I0aQU2U +# /0NzUiIFIW80SvxeDWn6I+hyVg/sdFSALP5JT7wAe8zTvsrI2hMpEVLdStFAMqan +# FYqtwZU5FoAsoPZ7h1ElWmKLZkXk8ePuALztNY1yseO0TwdueIGcIwItrlBYg1Xp +# Pz1+pMhGMVble6KHunaKo5K/ldOM0mQQT4Vjg6ZbzRIVRoDcArQ5//0875jOUvJt +# Yyc7Hl04jcmvjEIXC3HjkUYvgHEWL0QF/4f7vLAchaEZ839/3GYOdqH5VVnZrUIB +# QB6DTaUILDCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUwDQYJKoZI +# hvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw +# DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x +# MjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAy +# MDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +# AQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg4r25Phdg +# M/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aORmsHFPPF +# dvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41JmTamDu6 +# GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5LFGc6XBp +# Dco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL64NF50Zu +# yjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9QZpGdc3E +# XzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj0XOmTTd0 +# lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqEUUbi0b1q +# GFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0kZSU2LlQ +# +QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435UsSFF5PA +# PBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB3TCCAdkw +# EgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTEmr6CkTxG +# NSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwGA1UdIARV +# MFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93d3cubWlj +# cm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNVHSUEDDAK +# BggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMC +# AYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo0T2UkFvX +# zpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20v +# cGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYI +# KwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDANBgkqhkiG +# 9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4sQaTlz0x +# M7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th542DYunKmC +# VgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRXud2f8449 +# xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBewVIVCs/wM +# nosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0DLzskYDS +# PeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+CljdQDzHVG2d +# Y3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFrDZ+kKNxn +# GSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFhbHP+Crvs +# QWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7ntdAoGokL +# jzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+oDEzfbzL +# 6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6FwZvKhggNN +# MIICNQIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hp +# bmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw +# b3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2EgT3BlcmF0aW9uczEn +# MCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkRDMDAtMDVFMC1EOTQ3MSUwIwYDVQQD +# ExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMKAQEwBwYFKw4DAhoDFQCJ +# ptLCZsE06NtmHQzB5F1TroFSBqCBgzCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRwyDAiGA8yMDIzMDkxOTE5MTEw +# NFoYDzIwMjMwOTIwMTkxMTA0WjB0MDoGCisGAQQBhFkKBAExLDAqMAoCBQDotHDI +# AgEAMAcCAQACAi5fMAcCAQACAhMzMAoCBQDotcJIAgEAMDYGCisGAQQBhFkKBAIx +# KDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSChCjAIAgEAAgMBhqAwDQYJKoZI +# hvcNAQELBQADggEBABSMhArCfMaUns9Ybi+bd7CrSqySoFW9FQHNYSc/7Z4kVIDH +# MOSWB04XzoJV+b5q9p40kFfOlc5b184s/ZuR0zXF8NOTag0yTpWUYZDo3OrdVa45 +# g1JiqIjXs1Mpilyf/r194uoB8G63Kyxv4tyQX01/UL1ohtT88bXEDl6pNb+Xyhu/ +# 3benlypP9gr5fXHU1AcSpR/fuLO2QX4Inqqsrn8073fZkUrFfXeHgYGscjH/6A8V +# xK3x86MVX85OKS7L48K64XMJmuNzDOPMz7fbFLtwrj3tXhnU179w/GuGdvFgRaPf +# VfxZcx4y31FR1J4hDsrSVj/eGul6ZvDhEP5llugxggQNMIIECQIBATCBkzB8MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNy +# b3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAdIhJDFKWL8tEQABAAAB0jAN +# BglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEEMC8G +# CSqGSIb3DQEJBDEiBCDABiZtIILyalxFaNkpSNLPyB6dnqa8Og8PeO2M5QwQvjCB +# +gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIMeAIJPf30i9ZbOExU557GwWNaLH +# 0Z5s65JFga2DeaROMIGYMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh +# c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD +# b3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw +# MTACEzMAAAHSISQxSli/LREAAQAAAdIwIgQgxHcZpEl6iRNRIzFH1U59AFtiyMD5 +# cXN76GiPGy+kKMAwDQYJKoZIhvcNAQELBQAEggIA0Ev33yJgxJMIh75Ft6iuoxJH +# qmm0N6lliYKEIWF42TZBKU4ubpdr1tca9Wt8bL/AagZ4tEEb1fKBJTwmedSQQOey +# cWdkjeXRlHqBkHEpz/u+yIl9/4KojgmxT9P0ZNfHPjQxt9Zb7wubc2N9tgJ6ZwXr +# Kx/1DZkiKwXXRbNga7yyVM924J0/xokBiDkWtWKF4UOdEAtAoQmxwtVFWnJBVVQK +# BV8bAgi4+5lGrD1PoX1/uLd1hsnr0+/qu/Lz8f20DcFmPrp+gEXLdDCvws93b9fx +# 3hSuuVawfT8XFnXEut989RtYBlYkOPgDIrUbuHj5EqmB19UnhOeFkvhMHEqq+XKo +# kO9mHo8WZOnMFYM8FeSclxl3z/3jrAEibfoXBpVXFv1F3GGt5WH+2UWs7JXTK01R +# tnDr6DRsMEIr0yw2g1cb//u0BkmcEwBXr51dNX3E0WAxqVJk9yjV+YuGLjeD569E +# wDGANqkm83LIALMCBaBAzjVoG8jVnR0gLXrca7i+ez1h/jVDl5GmGcVfdgvxzDYk +# +uMpr/FsnoEFMGiBe/9l72gXY7pnoCipoNTx6q3GA3cfzfVDw27c8AzCny1DHUvj +# cUPCdId96d7eIR//lZo+DnJdQ+rsPlDuqpPdoldS/TzlCl+5Z8idTtxp9kSqzt8O +# aZYYi6hivyQoGN3avBU= +# SIG # End signature block diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml new file mode 100644 index 000000000000..247435745a35 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels new file mode 100644 index 000000000000..756a7cb14f58 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt new file mode 100644 index 000000000000..fb4a5e9becd1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/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://learn.microsoft.com/powershell/azure diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll new file mode 100644 index 000000000000..66f3d3165b86 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7e98f30fc54a Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..02168e3b1856 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll new file mode 100644 index 000000000000..2593da6045ce Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..87f0bdfe02f2 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..2a1b17bc86a4 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9f13f1f8a4fd Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..92419a27e0c2 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..674ced0460de Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..c5ba4e4047a1 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll new file mode 100644 index 000000000000..4b4b2f2b663d Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll new file mode 100644 index 000000000000..5662a76ad958 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll new file mode 100644 index 000000000000..3e0a147d4bcb Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll new file mode 100644 index 000000000000..a7d555909366 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 000000000000..f793fd89bece Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll new file mode 100644 index 000000000000..36fb33af4590 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll new file mode 100644 index 000000000000..2a353ee22eec Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..19d0fc0e971c Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll new file mode 100644 index 000000000000..70162a8713a2 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll new file mode 100644 index 000000000000..aca4cb32691f Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll new file mode 100644 index 000000000000..24735b8531b8 Binary files /dev/null and b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll differ diff --git a/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp new file mode 100644 index 000000000000..d07e7bb54153 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.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://learn.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.13.1 + 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 PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig 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_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig 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 PSCommand_Set-AzConfig + NuGet, Version=6.6.1.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 10.0.17763.0;.NET Framework 4.7.2 + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/storage.DefaultTag/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..9fdde1fbf3e8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/AsyncJob.cs b/swaggerci/storage.DefaultTag/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..2a2229afe873 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/AsyncOperationResponse.cs b/swaggerci/storage.DefaultTag/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..a38205a69ab0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..ae2348180e17 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..5044ed04c0e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..028358ce3c35 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..5c0b1b9c6c8d --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.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. + *--------------------------------------------------------------------------------------------*/ +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; } + + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { 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, AddComplexInterfaceInfo.IsPresent); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..e509fa24f68f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..bde2539b891e --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.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.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; } + + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { 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, AddComplexInterfaceInfo.IsPresent); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..3e3abe6db390 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..a3341f228cd6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..9cdc213c4feb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..16225b521623 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..75cae93cc869 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..3e49e35e8410 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..74000753ba92 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.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. + *--------------------------------------------------------------------------------------------*/ +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, bool AddComplexInterfaceInfo = true) + { + 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}"); + if (markdownInfo.Aliases.Any()) + { + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + } + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + + if (AddComplexInterfaceInfo) + { + 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.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..cdd53f584a12 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..cc13a1f08a09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.microsoft.com/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.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..ffe878e76cdd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..1ed65e213160 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..b80f51ca4c9f --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,635 @@ +/*--------------------------------------------------------------------------------------------- + * 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 ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($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 = $PSVersionTable.PSVersion.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(); + //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to + //override default value set in required readme + if ("SubscriptionId".Equals(parameterName)) + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); + sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + 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.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..2cfa7e9a79e7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.microsoft.com/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.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..9e60aa9f7fe1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/PsAttributes.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. + *--------------------------------------------------------------------------------------------*/ +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.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + + [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.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..29168379578a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..b6a54bda7d0b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..acaa215afe2a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..0198e73492f4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/CmdInfoHandler.cs b/swaggerci/storage.DefaultTag/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..540393fa936f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/ConversionException.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..49e2c9b87ca3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..497a88b30ba7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..681bc8db0e12 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..c178c5308e10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..348a9042eb36 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..2973b3510aa1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..5e821a646ec0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..021847215ec8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..f8f7b4788637 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..4f5c800df560 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..5bc4ed46bc64 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..9f2793703b9c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..5012d60972aa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..bb1df5b11bb5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..99b14c912104 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..13386dd1ccf7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..fcd676a9cc9f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..d8cd6e4eb544 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..3bd24b600ef3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..67b7ec0fcf94 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..3d833b982023 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..e91c7b3815cc --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..294cb3d7a861 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..fe245d57bb3b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..f0907b95fbf6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..61e5d344b5c9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..2eccf359731e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..8594b09d5b3b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..b2203df7214a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..26bcf9513b43 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonNode.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..0aa63b5fc636 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..19b1c919858e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonObject.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..ee38d67ea11b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonString.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..d25574080724 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..625abbeb725c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Debugging.cs b/swaggerci/storage.DefaultTag/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..7681b20d18ba --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/DictionaryExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..956250092aff --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/EventData.cs b/swaggerci/storage.DefaultTag/generated/runtime/EventData.cs new file mode 100644 index 000000000000..873324f39162 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/EventDataExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..3a07dc0b5d42 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/EventListener.cs b/swaggerci/storage.DefaultTag/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..677f19349734 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Events.cs b/swaggerci/storage.DefaultTag/generated/runtime/Events.cs new file mode 100644 index 000000000000..5b5f3f083fe8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/EventsExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..b32b2c97f75c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Extensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..441644a826cb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..1ecf8a11674b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..eefab199f5f2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Seperator.cs b/swaggerci/storage.DefaultTag/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..4372715758e3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/storage.DefaultTag/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..f7883dcc5067 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Helpers/XHelper.cs b/swaggerci/storage.DefaultTag/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..bb22a090b5d9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/HttpPipeline.cs b/swaggerci/storage.DefaultTag/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..152fb4aa5fc5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/storage.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..8b2e7b6daa13 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/IAssociativeArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..a0cb7beb21e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/IHeaderSerializable.cs b/swaggerci/storage.DefaultTag/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..5511c5d04b5a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/ISendAsync.cs b/swaggerci/storage.DefaultTag/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..b982fb5c3386 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/InfoAttribute.cs b/swaggerci/storage.DefaultTag/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..ad6bafc086bb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Iso/IsoDate.cs b/swaggerci/storage.DefaultTag/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..c83bb04b16ac --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/JsonType.cs b/swaggerci/storage.DefaultTag/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..637d96b695aa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/MessageAttribute.cs b/swaggerci/storage.DefaultTag/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..b8454fde0284 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/MessageAttribute.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. + *--------------------------------------------------------------------------------------------*/ +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 string DeprecateByAzVersion { get; } + + //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, string deprecateByAzVersion, string deprecateByVersion) + { + _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; + this.DeprecateByVersion = deprecateByVersion; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByAzVersion = deprecateByAzVersion; + + 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"))); + } + + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + 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(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, 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, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, 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 DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; + } + + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) + { + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } + } + + 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, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, 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, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, 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.DefaultTag/generated/runtime/MessageAttributeHelper.cs b/swaggerci/storage.DefaultTag/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..8658bc58dbdb --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,184 @@ +// ---------------------------------------------------------------------------------- +// +// 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 + { + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + 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 showPreviewMessage = true) + { + 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; + } + if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile")) + { + psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); + } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + } + + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + psCmdlet.WriteWarning(sb.ToString()); + } + } + + /** + * 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)); + } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + + 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.DefaultTag/generated/runtime/Method.cs b/swaggerci/storage.DefaultTag/generated/runtime/Method.cs new file mode 100644 index 000000000000..3f0d8968fe8d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonMember.cs b/swaggerci/storage.DefaultTag/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..2dbcafc25d25 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonModel.cs b/swaggerci/storage.DefaultTag/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..0e63758481e4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonModelCache.cs b/swaggerci/storage.DefaultTag/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..707ad24d8d3d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..71a2e3c9952f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..89956b958e20 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..e440a67fe880 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..040b01728d82 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..c717ce053fe6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..5d439533da3b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonDate.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..f62af1b0239e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonNode.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..791cc4bfb485 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..c4087170d3c3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonObject.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..0f3fcee0d2cf --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonString.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..ff96f8e850fa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/XBinary.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..d1c6ea747a6a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Nodes/XNull.cs b/swaggerci/storage.DefaultTag/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..7eec27f33077 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..cc41543b2d5a --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonParser.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..fc24e6dca0e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonToken.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..3a5af4e1e3c9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..009211eec2f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/Location.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..390f4bcc59b0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..8feaf5fa14ec --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Parser/TokenReader.cs b/swaggerci/storage.DefaultTag/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..dca9d95f755b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/PipelineMocking.cs b/swaggerci/storage.DefaultTag/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..29ff2d3d3744 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/storage.DefaultTag/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..8f9b59625a76 --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5655 @@ +//------------------------------------------------------------------------------ +// +// 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 version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", 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 The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. + /// + 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); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/runtime/Properties/Resources.resx b/swaggerci/storage.DefaultTag/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..a08a2e50172b --- /dev/null +++ b/swaggerci/storage.DefaultTag/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1747 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 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. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' + + \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/generated/runtime/Response.cs b/swaggerci/storage.DefaultTag/generated/runtime/Response.cs new file mode 100644 index 000000000000..bea09d68fcd2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/storage.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..dc84b14cec00 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/storage.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..c933f2215862 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/storage.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..721bdffec894 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/SerializationMode.cs b/swaggerci/storage.DefaultTag/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..b14dbb32de4c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/TypeConverterExtensions.cs b/swaggerci/storage.DefaultTag/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..47b16dd82929 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/UndeclaredResponseException.cs b/swaggerci/storage.DefaultTag/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..3005ed0b86f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/Writers/JsonWriter.cs b/swaggerci/storage.DefaultTag/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..24b423879659 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/generated/runtime/delegates.cs b/swaggerci/storage.DefaultTag/generated/runtime/delegates.cs new file mode 100644 index 000000000000..5f98054a63dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/how-to.md b/swaggerci/storage.DefaultTag/how-to.md new file mode 100644 index 000000000000..3b409dd61a47 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.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.DefaultTag/internal/Az.Storage.internal.psm1 b/swaggerci/storage.DefaultTag/internal/Az.Storage.internal.psm1 new file mode 100644 index 000000000000..52a3ba59e690 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/internal/Get-AzStorageOperation.ps1 b/swaggerci/storage.DefaultTag/internal/Get-AzStorageOperation.ps1 new file mode 100644 index 000000000000..2f41971fdf37 --- /dev/null +++ b/swaggerci/storage.DefaultTag/internal/Get-AzStorageOperation.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.IOperation +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageoperation +#> +function Get-AzStorageOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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.DefaultTag/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/storage.DefaultTag/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..2f41971fdf37 --- /dev/null +++ b/swaggerci/storage.DefaultTag/internal/ProxyCmdletDefinitions.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.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.Api20230501.IOperation +.Link +https://learn.microsoft.com/powershell/module/az.storage/get-azstorageoperation +#> +function Get-AzStorageOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20230501.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${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.DefaultTag/internal/README.md b/swaggerci/storage.DefaultTag/internal/README.md new file mode 100644 index 000000000000..6cfd1b11f8b3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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://learn.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.DefaultTag/license.txt b/swaggerci/storage.DefaultTag/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/pack-module.ps1 b/swaggerci/storage.DefaultTag/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/readme.md b/swaggerci/storage.DefaultTag/readme.md new file mode 100644 index 000000000000..e8b392c420a1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/resources/README.md b/swaggerci/storage.DefaultTag/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/run-module.ps1 b/swaggerci/storage.DefaultTag/run-module.ps1 new file mode 100644 index 000000000000..2bb03a71dd17 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test-module.ps1 b/swaggerci/storage.DefaultTag/test-module.ps1 new file mode 100644 index 000000000000..9589b75627e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test-module.ps1 @@ -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. +# ---------------------------------------------------------------------------------- +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 + } else { + $env:AzPSAutorestTestPlaybackMode = $true + } + $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 + } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/test/Clear-AzStorageBlobContainerLegalHold.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Clear-AzStorageBlobContainerLegalHold.Tests.ps1 new file mode 100644 index 000000000000..6521abeb64e0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageAccount.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..6da7a1557535 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageAccountCustomerInitiatedMigration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountCustomerInitiatedMigration.Tests.ps1 new file mode 100644 index 000000000000..a0c65d98229e --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountCustomerInitiatedMigration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccountCustomerInitiatedMigration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccountCustomerInitiatedMigration.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-AzStorageAccountCustomerInitiatedMigration' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountKey.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountKey.Tests.ps1 new file mode 100644 index 000000000000..4c03cf7e3998 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageAccountProperty.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountProperty.Tests.ps1 new file mode 100644 index 000000000000..e3a25f2b47e9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageAccountSas.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountSas.Tests.ps1 new file mode 100644 index 000000000000..be291587b3c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageAccountServiceSas.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageAccountServiceSas.Tests.ps1 new file mode 100644 index 000000000000..e50021f0160b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..2f78c7bf0317 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..3dcf349c54f6 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..ed7b52c727c8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageBlobService.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageBlobService.Tests.ps1 new file mode 100644 index 000000000000..ea69ab618430 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageBlobServiceProperty.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageBlobServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..bf60530b7a41 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageDeletedAccount.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageDeletedAccount.Tests.ps1 new file mode 100644 index 000000000000..93649abb0060 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageEncryptionScope.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageEncryptionScope.Tests.ps1 new file mode 100644 index 000000000000..023b3d911444 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageFileService.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageFileService.Tests.ps1 new file mode 100644 index 000000000000..474899d7cb51 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageFileServiceProperty.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageFileServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..64e11923bf91 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..d8f43b05eba0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..d1ba37ab60fd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageLocalUserKey.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageLocalUserKey.Tests.ps1 new file mode 100644 index 000000000000..96f762891b87 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..21206b38c3eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageNetworkSecurityPerimeterConfiguration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageNetworkSecurityPerimeterConfiguration.Tests.ps1 new file mode 100644 index 000000000000..8c0d390f73d2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Get-AzStorageNetworkSecurityPerimeterConfiguration.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageNetworkSecurityPerimeterConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageNetworkSecurityPerimeterConfiguration.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-AzStorageNetworkSecurityPerimeterConfiguration' { + 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.DefaultTag/test/Get-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..021d19e08c85 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStoragePrivateEndpointConnection.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStoragePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..f8ff8865f41d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStoragePrivateLinkResource.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStoragePrivateLinkResource.Tests.ps1 new file mode 100644 index 000000000000..6f835195a6f8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageQueue.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..9c100ecd95ce --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageQueueService.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageQueueService.Tests.ps1 new file mode 100644 index 000000000000..a373096b9783 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageQueueServiceProperty.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageQueueServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..984ce17a68e8 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageSku.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageSku.Tests.ps1 new file mode 100644 index 000000000000..460482e6074f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageTable.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..89831a4301ca --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageTableService.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTableService.Tests.ps1 new file mode 100644 index 000000000000..3496c4887622 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageTableServiceProperty.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTableServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..8b7202009031 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Get-AzStorageTaskAssignment.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignment.Tests.ps1 new file mode 100644 index 000000000000..0ddedbd588eb --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignment.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTaskAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTaskAssignment.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-AzStorageTaskAssignment' { + 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.DefaultTag/test/Get-AzStorageTaskAssignmentInstancesReport.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignmentInstancesReport.Tests.ps1 new file mode 100644 index 000000000000..5cc280077a7e --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignmentInstancesReport.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTaskAssignmentInstancesReport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTaskAssignmentInstancesReport.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-AzStorageTaskAssignmentInstancesReport' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignmentsInstancesReport.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignmentsInstancesReport.Tests.ps1 new file mode 100644 index 000000000000..60c5b9a19209 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Get-AzStorageTaskAssignmentsInstancesReport.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTaskAssignmentsInstancesReport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTaskAssignmentsInstancesReport.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-AzStorageTaskAssignmentsInstancesReport' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Get-AzStorageUsage.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Get-AzStorageUsage.Tests.ps1 new file mode 100644 index 000000000000..3f891ec88917 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Tests.ps1 new file mode 100644 index 000000000000..b7aa18622b7f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.Tests.ps1 new file mode 100644 index 000000000000..086460337ae0 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageCustomerStorageAccountInitiatedMigration.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageCustomerStorageAccountInitiatedMigration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageCustomerStorageAccountInitiatedMigration.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-AzStorageCustomerStorageAccountInitiatedMigration' { + It 'CustomerExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Customer' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CustomerViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CustomerViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..a04aa0725948 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Tests.ps1 new file mode 100644 index 000000000000..90d32794d368 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageLeaseBlobContainer.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageLeaseBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..0c313dfc0788 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageLeaseFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageLeaseFileShare.Tests.ps1 new file mode 100644 index 000000000000..43057b7595f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageObjectBlobContainerLevelWorm.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageObjectBlobContainerLevelWorm.Tests.ps1 new file mode 100644 index 000000000000..91d46a040306 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.Tests.ps1 new file mode 100644 index 000000000000..b8fbb401ca30 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageReconcileNetworkSecurityPerimeterConfiguration.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-AzStorageReconcileNetworkSecurityPerimeterConfiguration' { + It 'Reconcile' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ReconcileViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Lock-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Lock-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..04d0d1c72b48 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageAccount.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..ae629d05df10 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageAccountKey.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageAccountKey.Tests.ps1 new file mode 100644 index 000000000000..a67536fa0a11 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..3f36f1bd6cdc --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..38c6a8a87ae3 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..2d5c25eb553e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..1408b8140eab --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..e9ea6863cb03 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageLocalUserPassword.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageLocalUserPassword.Tests.ps1 new file mode 100644 index 000000000000..8cb061ff1cb7 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..d31c7eade591 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..01303149fbd2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageQueue.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..f947749bf44e --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageTable.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..cd04075b3a18 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/New-AzStorageTaskAssignment.Tests.ps1 b/swaggerci/storage.DefaultTag/test/New-AzStorageTaskAssignment.Tests.ps1 new file mode 100644 index 000000000000..891cda5ba5f5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/New-AzStorageTaskAssignment.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageTaskAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageTaskAssignment.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-AzStorageTaskAssignment' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/README.md b/swaggerci/storage.DefaultTag/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageAccount.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..7be08d385468 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..f85b66968736 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..cb770a548e0f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..e393c13dfa91 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..cd6158f0f7b1 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..8c4685a9ccfa --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..be6beac3506d --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..114ae3d844d9 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStoragePrivateEndpointConnection.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStoragePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..c2b2555694ab --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageQueue.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..30c4f65768b4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageTable.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..9d61c9298d2b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Remove-AzStorageTaskAssignment.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Remove-AzStorageTaskAssignment.Tests.ps1 new file mode 100644 index 000000000000..d2d4f529941d --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Remove-AzStorageTaskAssignment.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageTaskAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageTaskAssignment.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-AzStorageTaskAssignment' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/Restore-AzStorageAccountBlobRange.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Restore-AzStorageAccountBlobRange.Tests.ps1 new file mode 100644 index 000000000000..36b95b4b632c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Restore-AzStorageFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Restore-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..9aa8a8ba32dd --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Revoke-AzStorageAccountUserDelegationKey.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Revoke-AzStorageAccountUserDelegationKey.Tests.ps1 new file mode 100644 index 000000000000..289a1055d29c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Test-AzStorageAccountNameAvailability.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Test-AzStorageAccountNameAvailability.Tests.ps1 new file mode 100644 index 000000000000..1fe3431ee96c --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageAccount.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..b7121ee74bbe --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..1d4ebd7281e5 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageEncryptionScope.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageEncryptionScope.Tests.ps1 new file mode 100644 index 000000000000..1b20809d1b6f --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageFileShare.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..8b9e9c9ad47b --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageQueue.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..f4dd7a70c3cf --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageTable.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..751e69048aa2 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/test/Update-AzStorageTaskAssignment.Tests.ps1 b/swaggerci/storage.DefaultTag/test/Update-AzStorageTaskAssignment.Tests.ps1 new file mode 100644 index 000000000000..13411639ec21 --- /dev/null +++ b/swaggerci/storage.DefaultTag/test/Update-AzStorageTaskAssignment.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageTaskAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageTaskAssignment.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-AzStorageTaskAssignment' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage.DefaultTag/test/loadEnv.ps1 b/swaggerci/storage.DefaultTag/test/loadEnv.ps1 new file mode 100644 index 000000000000..d2166fb535d4 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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=@{"*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/test/utils.ps1 b/swaggerci/storage.DefaultTag/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 b/swaggerci/storage.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/swaggerci/storage.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/swaggerci/storage.DefaultTag/utils/Unprotect-SecureString.ps1 b/swaggerci/storage.DefaultTag/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/storage.DefaultTag/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